Line
Link Here
|
0 |
-- cscope-15.5.orig/src/main.c |
0 |
++ cscope-15.5/src/main.c |
Lines 330-338
Link Here
|
330 |
} |
330 |
} |
331 |
|
331 |
|
332 |
/* create the temporary file names */ |
332 |
/* create the temporary file names */ |
333 |
pid = getpid(); |
333 |
do { |
334 |
(void) sprintf(temp1, "%s/cscope%d.1", tmpdir, pid); |
334 |
char *tempfile = tempnam(tmpdir, "cscope1"); |
335 |
(void) sprintf(temp2, "%s/cscope%d.2", tmpdir, pid); |
335 |
if (!tempfile) { |
|
|
336 |
fputs ("Can't create tempfile\n", stderr); |
337 |
exit (1); |
338 |
} |
339 |
if (strlen(tempfile) >= sizeof(temp1)) { |
340 |
fputs ("TMPDIR path is too long\n", stderr); |
341 |
exit(1); |
342 |
} |
343 |
strncpy (temp1, tempfile, sizeof (temp1)); |
344 |
} while (open (temp1, O_CREAT|O_EXCL|O_WRONLY, 0600) < 0); |
345 |
do { |
346 |
char *tempfile = tempnam(tmpdir, "cscope2"); |
347 |
if (!tempfile) { |
348 |
fputs ("Can't create tempfile\n", stderr); |
349 |
exit (1); |
350 |
} |
351 |
if (strlen(tempfile) >= sizeof(temp2)) { |
352 |
fputs ("TMPDIR path is too long\n", stderr); |
353 |
exit(1); |
354 |
} |
355 |
strncpy (temp2, tempfile, sizeof (temp2)); |
356 |
} while (open (temp2, O_CREAT|O_EXCL|O_WRONLY, 0600) < 0); |
357 |
|
336 |
|
358 |
|
337 |
/* if running in the foreground */ |
359 |
/* if running in the foreground */ |
338 |
if (signal(SIGINT, SIG_IGN) != SIG_IGN) { |
360 |
if (signal(SIGINT, SIG_IGN) != SIG_IGN) { |