Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.145
 
1.146
 
MAIN:gmcgarry:20090219104314
 
cc.c
_>12271227 {
 12281228         int t, status = 0;
 12291229         pid_t p;
<>1230 -        char *s;
  1230+        char *s, *a = NULL;
  1231+        size_t len = 0;
12311232 
 12321233         if (vflag) {
 12331234                 fprintf(stderr, "%s ", f);
     
 !
12361237                 fprintf(stderr, "\n");
 12371238         }
 12381239 
<> 1240+        if (Bflag) {
  1241+                len = strlen(Bflag) + 8;
  1242+                a = malloc(len);
  1243+        }
  1244+#ifdef HAVE_VFORK
  1245+        if ((p = vfork()) == 0) {
  1246+#else
12391247         if ((p = fork()) == 0) {
<> 1248+#endif
12401249                 if (Bflag) {
<>1241 -                        size_t len = strlen(Bflag) + 8;
 1242 -                        char *a = malloc(len);
12431250                         if (a == NULL) {
 12441251                                 error("callsys: malloc failed");
 12451252                                 exit(1);
     
 !
12551262                         execvp(s+1, v);
 12561263                 fprintf(stderr, "Can't find %s\n", f);
 12571264                 _exit(100);
<>1258 -        } else {
 1259 -                if (p == -1) {
 1260 -                        printf("Try again\n");
 1261 -                        return(100);
 1262 -                }
12631265         }
<> 1266+        if (p == -1) {
  1267+                fprintf(stderr, "fork() failed, try again\n");
  1268+                return(100);
  1269+        }
  1270+        if (Bflag) {
  1271+                free(a);
  1272+        }
<_12641273         while (waitpid(p, &status, 0) == -1 && errno == EINTR)
 12651274                 ;
 12661275         if (WIFEXITED(status))
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-18 14:29 +0100