]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Make the newly-introduced critical section a bit smaller.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 13 Nov 2004 01:02:48 +0000 (01:02 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 13 Nov 2004 01:02:48 +0000 (01:02 +0000)
src/sort.c

index 7c541d796d84ec12d9763ac95c29392b45c3ba73..3b6cfb09b51fd5d3bc1844d1227924bf9f002ff8 100644 (file)
@@ -528,11 +528,13 @@ zaptemp (const char *name)
     if (node->name == name)
       {
        /* Unlink the temporary file in a critical section, to avoid races.  */
+       struct tempnode *t = node->next;
        sigprocmask (SIG_BLOCK, &caught_signals, &oldset);
        unlink (name);
-       if (! (*pnode = node->next))
-         temptail = pnode;
+       *pnode = t;
        sigprocmask (SIG_SETMASK, &oldset, NULL);
+       if (! t)
+         temptail = pnode;
        free (node);
        break;
       }