1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-04 15:49:42 +02:00

Make the newly-introduced critical section a bit smaller.

This commit is contained in:
Paul Eggert
2004-11-13 01:02:48 +00:00
parent fc19c2ddad
commit 1b2e96f830
+4 -2
View 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;
}