From: Junio C Hamano Date: Fri, 15 Oct 2010 21:16:57 GMT Subject: Re: [PATCH v4 15/15] daemon: opt-out on features that require posix Message-ID: <7vbp6vduly.fsf@alter.siamese.dyndns.org> In-Reply-To: Erik Faye-Lund writes: >>> -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?