On Wed, Feb 03, 2016 at 06:02:55PM +0100, Florian Stinglmayr wrote: > Michael's patch is very nice and should definitely make it in. > > Yet after speaking with upstream the other day it was made very clear to > me that upstream wants the patch in their repository. Since my upstream > patch requires a change in configure.ac (and thus a rerunning > autoreconf) I don't want to put it in ports. So my plan is:
Great! > 1. Use Michael's patch until upstream releases a new version. > 2. Send Michael's patch upstream. > 3. Wait for new version. > 4. Update port, remove old patches. > > Attached below is the git patch that will go upstream. I'd appreciate > any feedback. Some feedback below. > diff --git a/src/main.c b/src/main.c > index 4d0e623..1551c0d 100644 > --- a/src/main.c > +++ b/src/main.c > @@ -35,6 +35,12 @@ int main(int argc, char **argv) { > int workers_len; > int num_cores; > > +#ifdef HAVE_PLEDGE > + if (pledge("stdio rpath proc exec", NULL) < 0) { Can you use the standard convention == -1? It's (almost?) universally checked that way. Makes it easier to spot errors when everything is consistent. > diff --git a/src/options.c b/src/options.c > index 6bc5b18..bcd452e 100644 > --- a/src/options.c > +++ b/src/options.c > @@ -600,6 +600,12 @@ void parse_options(int argc, char **argv, char > **base_paths[], char **paths[]) { > } > } > > +#ifdef HAVE_PLEDGE > + if (opts.skip_vcs_ignores && pledge("stdio rpath proc", NULL) < 0) { This is a minor nit, but almost every other one is "if (pledge(". > +#ifdef HAVE_PLEDGE > + if (pledge("stdio rpath proc", NULL) < -1) { This will never happen. It should be == -1.