mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
Make the newly-introduced critical section a bit smaller.
This commit is contained in:
1 parent
fc19c2ddad
commit
1b2e96f830
1 file changed
+4
-2
+4
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user