diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2004-11-13 01:02:48 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2004-11-13 01:02:48 +0000 |
commit | 1b2e96f8302bb0eb80c30ec27ab13d4d0f1a7912 (patch) | |
tree | ec69a4f9e86de950be5c0d90a00f4e5eb00658cb /src | |
parent | fc19c2ddadad27eefa25a06e19f6b45c319ce2da (diff) | |
download | coreutils-1b2e96f8302bb0eb80c30ec27ab13d4d0f1a7912.tar.xz |
Make the newly-introduced critical section a bit smaller.
Diffstat (limited to 'src')
-rw-r--r-- | src/sort.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sort.c b/src/sort.c index 7c541d796..3b6cfb09b 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; } |