[BACK]Return to function.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / find

Diff for /src/usr.bin/find/function.c between version 1.48 and 1.49

version 1.48, 2020/04/09 10:27:32 version 1.49, 2020/04/09 15:07:49
Line 588 
Line 588 
   
         if (new->flags & F_PLUSSET) {          if (new->flags & F_PLUSSET) {
                 long arg_max;                  long arg_max;
                   extern char **environ;
                   char **ep;
                 u_int c, bufsize;                  u_int c, bufsize;
   
                 cnt = ap - *argvp - 1;                  /* units are words */                  cnt = ap - *argvp - 1;                  /* units are words */
Line 605 
Line 607 
                  */                   */
                 arg_max = sysconf(_SC_ARG_MAX);                  arg_max = sysconf(_SC_ARG_MAX);
                 if (arg_max == -1)                  if (arg_max == -1)
                         err(1, "sysconf(_SC_ARG_MAX) failed");                          err(1, "-exec: sysconf(_SC_ARG_MAX) failed");
                   for (ep = environ; *ep != NULL; ep++) {
                           /* 1 byte for each '\0' */
                           arg_max -= strlen(*ep) + 1 + sizeof(*ep);
                   }
   
                 /*                  /*
                  * Count up the space of the user's arguments, and                   * Count up the space of the user's arguments, and
Line 617 
Line 623 
                         c += strlen(*argv) + 1;                          c += strlen(*argv) + 1;
                         new->e_argv[cnt] = *argv;                          new->e_argv[cnt] = *argv;
                 }                  }
                   if (arg_max < 4 * 1024 + c)
                           errx(1, "-exec: no space left to run child command");
                 bufsize = arg_max - 4 * 1024 - c;                  bufsize = arg_max - 4 * 1024 - c;
   
                 /*                  /*

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49