From: Paul Eggert Date: Sat, 13 Nov 2004 01:02:48 +0000 (+0000) Subject: Make the newly-introduced critical section a bit smaller. X-Git-Tag: v5.3.0~431 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b2e96f8302bb0eb80c30ec27ab13d4d0f1a7912;p=thirdparty%2Fcoreutils.git Make the newly-introduced critical section a bit smaller. --- diff --git a/src/sort.c b/src/sort.c index 7c541d796d..3b6cfb09b5 100644 --- a/src/sort.c +++ b/src/sort.c @@ -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; }