mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-30 05:36:10 +00:00
wc: Fix SIGINFO race with casper init.
If a file is specified then fileargs_init(3) may return [EINTR]. With the SIGINFO handler not being SA_RESTART this causes an early exit if a SIGINFO comes in. Rather than checking for [EINTR] or changing the handler just move it later which resolves the problem.
This commit is contained in:
parent
a890a3a5dd
commit
d0bf8b5aac
|
@ -117,8 +117,6 @@ main(int argc, char *argv[])
|
|||
argv += optind;
|
||||
argc -= optind;
|
||||
|
||||
(void)signal(SIGINFO, siginfo_handler);
|
||||
|
||||
fa = fileargs_init(argc, argv, O_RDONLY, 0,
|
||||
cap_rights_init(&rights, CAP_READ, CAP_FSTAT), FA_OPEN);
|
||||
if (fa == NULL)
|
||||
|
@ -137,6 +135,7 @@ main(int argc, char *argv[])
|
|||
xo_open_container("wc");
|
||||
xo_open_list("file");
|
||||
|
||||
(void)signal(SIGINFO, siginfo_handler);
|
||||
errors = 0;
|
||||
total = 0;
|
||||
if (argc == 0) {
|
||||
|
|
Loading…
Reference in a new issue