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

Diff for /src/usr.bin/awk/run.c between version 1.82 and 1.83

version 1.82, 2023/11/25 16:31:33 version 1.83, 2023/11/28 20:54:38
Line 2069 
Line 2069 
         int status = 0;          int status = 0;
         time_t tv;          time_t tv;
         struct tm *tm, tmbuf;          struct tm *tm, tmbuf;
           int estatus = 0;
   
         t = ptoi(a[0]);          t = ptoi(a[0]);
         x = execute(a[1]);          x = execute(a[1]);
Line 2169 
Line 2170 
                 break;                  break;
         case FSYSTEM:          case FSYSTEM:
                 fflush(stdout);         /* in case something is buffered already */                  fflush(stdout);         /* in case something is buffered already */
                 status = system(getsval(x));                  estatus = status = system(getsval(x));
                 u = status;  
                 if (status != -1) {                  if (status != -1) {
                         if (WIFEXITED(status)) {                          if (WIFEXITED(status)) {
                                 u = WEXITSTATUS(status);                                  estatus = WEXITSTATUS(status);
                         } else if (WIFSIGNALED(status)) {                          } else if (WIFSIGNALED(status)) {
                                 u = WTERMSIG(status) + 256;                                  estatus = WTERMSIG(status) + 256;
 #ifdef WCOREDUMP  #ifdef WCOREDUMP
                                 if (WCOREDUMP(status))                                  if (WCOREDUMP(status))
                                         u += 256;                                          estatus += 256;
 #endif  #endif
                         } else  /* something else?!? */                          } else  /* something else?!? */
                                 u = 0;                                  estatus = 0;
                 }                  }
                   /* else estatus was set to -1 */
                   u = estatus;
                 break;                  break;
         case FRAND:          case FRAND:
                 /* random() returns numbers in [0..2^31-1]                  /* random() returns numbers in [0..2^31-1]

Legend:
Removed from v.1.82  
changed lines
  Added in v.1.83