Thread (7 messages) 7 messages, 3 authors, 2016-06-15

Re: [PATCH v4 15/15] daemon: opt-out on features that require posix

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:47

Possibly related (same subject, not in this thread)

Erik Faye-Lund [off-list ref] writes:
quoted
quoted
-static int serve(struct string_list *listen_addr, int listen_port, struct passwd *pass, gid_t gid)
+#ifndef NO_POSIX_GOODIES
+static struct passwd *pass;
+static gid_t gid;
+#endif
+
+static int serve(struct string_list *listen_addr, int listen_port)
 {
      struct socketlist socklist = { NULL, 0, 0 };
This is ugly.  Why did you need to make the arguments file-scope static?
To avoid having different signatures for the serve-function dependent
on NO_POSIX_GOODIES.
Why does the signature even have to be different between the two to begin
with?  I _think_ you have gid_t over there, although you might not have
"struct passwd", in which case you can just define an empty one that your
alternate implementation is not going to use anyway.  This is especially
true if you are making the "drop-privileges" part a helper function, no?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help