]> git.ipfire.org Git - thirdparty/coreutils.git/commit
sort: avoid issues when issuing diagnostics from child processes
authorPádraig Brady <P@draigBrady.com>
Tue, 26 Nov 2013 02:47:36 +0000 (02:47 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 27 Nov 2013 01:21:23 +0000 (01:21 +0000)
commit39e0c9ba5d7a37401a30e1304282142e525e334c
tree2ad5539c95cb1b532f5a467a90ed8b2c778b7fd1
parent17bce8c63e9e0f85b48ca62b63413ce9102af5c1
sort: avoid issues when issuing diagnostics from child processes

* src/sort.c: (async_safe_die): A new limited version of error(),
that outputs fixed strings and unconverted errnos to stderr.
This is safe to call in the limited context of a signal handler,
or in this particular case, between the fork() and exec() of
a multithreaded process.
(move_fd_or_die): Use the async_safe_die() rather than error().
(maybe_create_temp): Likewise.
(open_temp): Likewise.
Fixes http://bugs.gnu.org/15970
src/sort.c