Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.29
 
1.30
 
MAIN:pj:20041220134102
 
cc.c
_>7676 #define MAXLIB 10000
 7777 #define MAXAV  10000
 7878 #define MAXOPT 100
<>79 -char    *tmp0;
8079 char    *tmp3;
 8180 char    *tmp4;
 8281 char    *outfile;
     
 !
9089 int cunlink(char *);
 9190 void dexit(void);
 9291 void idexit(int);
<> 92+char *gettmp();
9393 # define CHSPACE 1000
 9494 char    ts[CHSPACE+50];
 9595 char    *tsa = ts;
     
 !
133133         char *assource;
 134134         char **pv, *ptemp[MAXOPT], **pvt;
 135135         int nc, nl, i, j, c, f20, nxo, na;
<>136 -        FILE *f;
137136 
 138137         i = nc = nl = f20 = nxo = 0;
 139138         pv = ptemp;
     
 !
295294         if(nc==0)
 296295                 goto nocom;
 297296         if (pflag==0) {
<>298 -                tmp0 = copy("/tmp/ctm0a");
 299 -                while((f=fopen(tmp0, "r")) != NULL) {
 300 -                        fclose(f);
 301 -                        tmp0[9]++;
 302 -                }
 303 -                while((creat(tmp0, 0400))<0)
 304 -                        tmp0[9]++;
  297+                tmp3 = gettmp();
  298+                tmp4 = gettmp();
305299         }
 306300         if (signal(SIGINT, SIG_IGN) != SIG_IGN/* interrupt */
 307301                 signal(SIGINT, idexit);
 308302         if (signal(SIGTERM, SIG_IGN) != SIG_IGN)        /* terminate */
 309303                 signal(SIGTERM, idexit);
<>310 -        (tmp3 = copy(tmp0))[8] = '3';
 311 -        if (pflag==0)
 312 -                (tmp4 = copy(tmp0))[8] = '4';
313304         pvt = pv;
 314305         for (i=0; i<nc; i++) {
 315306                 /*
     
 !
479470                 if (sflag==0)
 480471                         cunlink(tmp3);
 481472                 cunlink(tmp4);
<>482 -                cunlink(tmp0);
483473         }
 484474         exit(eflag);
 485475 }
     
 !
604594                 return(0);
 605595         return(unlink(f));
 606596 }
<_ 597+
  598+char *
  599+gettmp()
  600+{
  601+        char *sfn = strdup("/tmp/ctm.XXXXXX");
  602+        int fd = -1;
  603+
  604+        if ((fd = mkstemp(sfn)) == -1) {
  605+                fprintf(stderr, "%s: %s\n", sfn, strerror(errno));
  606+                exit(8);
  607+        }
  608+        close(fd);
  609+
  610+        return sfn;
  611+}
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-28 05:07 +0200