Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Job_TempFile: unlink while signals blocked



details:   https://anonhg.NetBSD.org/src/rev/0d486a41d909
branches:  trunk
changeset: 959239:0d486a41d909
user:      sjg <sjg%NetBSD.org@localhost>
date:      Fri Feb 05 22:15:44 2021 +0000

description:
Job_TempFile: unlink while signals blocked

diffstat:

 usr.bin/make/job.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r a3dbb17f1572 -r 0d486a41d909 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Fri Feb 05 21:48:52 2021 +0000
+++ b/usr.bin/make/job.c        Fri Feb 05 22:15:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.419 2021/02/05 19:19:17 sjg Exp $    */
+/*     $NetBSD: job.c,v 1.420 2021/02/05 22:15:44 sjg Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.419 2021/02/05 19:19:17 sjg Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.420 2021/02/05 22:15:44 sjg Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -1582,8 +1582,6 @@
        }
 
        tfd = Job_TempFile(TMPPAT, tfile, sizeof tfile);
-       if (!DEBUG(SCRIPT))
-           eunlink(tfile);
 
        job->cmdFILE = fdopen(tfd, "w+");
        if (job->cmdFILE == NULL)
@@ -2768,6 +2766,8 @@
 
        JobSigLock(&mask);
        fd = mkTempFile(pattern, tfile, tfile_sz);
+       if (tfile != NULL && !DEBUG(SCRIPT))
+           unlink(tfile);
        JobSigUnlock(&mask);
 
        return fd;



Home | Main Index | Thread Index | Old Index