URI: 
       tReplace execvpe() call with execvp() - wendy - watch files/directories and run commands on any event
  HTML git clone git://z3bra.org/wendy
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 1cfef0a6de2446814e1947e5bc0e73ab744f2d6d
   DIR parent d8f37c773ffd11256084aec460d136491310bbbe
  HTML Author: z3bra <willyatmailoodotorg>
       Date:   Fri, 29 Apr 2016 20:14:25 +0200
       
       Replace execvpe() call with execvp()
       
       The `execvpe()` implementation I had was hacky, inadequate and
       disrespectful regarding the `const` attributes specified in `unistd.h`.
       Moreover, `execvpe()` require _GNU_SOURCE to be set for no particular
       advantage in our case.
       
       Diffstat:
         M wendy.c                             |      15 +--------------
       
       1 file changed, 1 insertion(+), 14 deletions(-)
       ---
   DIR diff --git a/wendy.c b/wendy.c
       t@@ -33,8 +33,6 @@ struct node_t {
                struct node_t *next;
        };
        
       -extern char **environ;
       -
        int verbose = 0, nb = 0;
        struct node_t *head = NULL;
        
       t@@ -101,17 +99,6 @@ read_filename(int fd)
                return NULL;
        }
        
       -int
       -execvpe(const char *program, char **argv, char **envp)
       -{
       -        char **saved = environ;
       -        int rc;
       -        environ = envp;
       -        rc = execvp(program, argv);
       -        environ = saved;
       -        return rc;
       -}
       -
        struct node_t *
        add_node(int wd, const char *path)
        {
       t@@ -262,7 +249,7 @@ main (int argc, char **argv)
                                        setenv(ENV_MASK, strmask, 1);
                                        setenv(ENV_PATH, EVENT_PATH(ev), 1);
                                        if (!fork())
       -                                if (!fork()) execvpe(cmd[0], cmd, environ);
       +                                if (!fork()) execvp(cmd[0], cmd);
                                        else exit(0);
                                        else wait(NULL);
                                }