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

Diff for /src/usr.bin/make/compat.c between version 1.9 and 1.10

version 1.9, 1998/01/02 05:56:33 version 1.10, 1998/05/12 07:10:01
Line 135 
Line 135 
   
 /*-  /*-
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
    * shellneed --
    *
    * Results:
    *      Returns 1 if a specified line must be executed by the shell,
    *      0 if it can be run via execve, and -1 if the command is a no-op.
    *
    * Side Effects:
    *      None.
    *
    *-----------------------------------------------------------------------
    */
   static int
   shellneed (cmd)
           char *cmd;
   {
           char **av;
           int ac;
   
           av = brk_string(cmd, &ac, TRUE);
           if (strcmp(av[1], "exit") == 0)
                   return (1);
           if (strcmp(av[1], "umask") == 0) {
                   long umi;
                   char *ep = NULL;
                   mode_t um;
   
                   if (av[2] != NULL) {
                           umi = strtol(av[2], &ep, 8);
                           if (ep == NULL)
                                   return (1);
                           um = umi;
                           (void) umask(um);
                           return (-1);
                   }
                   um = umask(0);
                   (void) umask(um);
                   printf("%o\n", um);
                   return (-1);
           }
   
           return (0);
   }
   
   /*-
    *-----------------------------------------------------------------------
  * CompatRunCommand --   * CompatRunCommand --
  *      Execute the next command for a target. If the command returns an   *      Execute the next command for a target. If the command returns an
  *      error, the node's made field is set to ERROR and creation stops.   *      error, the node's made field is set to ERROR and creation stops.
Line 166 
Line 211 
                                  * dynamically allocated */                                   * dynamically allocated */
     Boolean       local;        /* TRUE if command should be executed      Boolean       local;        /* TRUE if command should be executed
                                  * locally */                                   * locally */
       int           internal;     /* Various values.. */
     char          *cmd = (char *) cmdp;      char          *cmd = (char *) cmdp;
     GNode         *gn = (GNode *) gnp;      GNode         *gn = (GNode *) gnp;
   
Line 253 
Line 299 
          * error.           * error.
          */           */
         static char     *shargv[4] = { "/bin/sh" };          static char     *shargv[4] = { "/bin/sh" };
   
           shargv[1] = (errCheck ? "-ec" : "-c");
           shargv[2] = cmd;
           shargv[3] = (char *)NULL;
           av = shargv;
           argc = 0;
       } else if ((internal = shellneed(cmd))) {
           /*
            * This command must be passed by the shell for other reasons..
            * or.. possibly not at all.
            */
           static char     *shargv[4] = { "/bin/sh" };
   
           if (internal == -1) {
                   /* Command does not need to be executed */
                   return (0);
           }
   
         shargv[1] = (errCheck ? "-ec" : "-c");          shargv[1] = (errCheck ? "-ec" : "-c");
         shargv[2] = cmd;          shargv[2] = cmd;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10