summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2020-07-04 11:23:36 +0000
committerkn <kn@cvs.openbsd.org>2020-07-04 11:23:36 +0000
commit12394eb3d13e77787a358468b6a19f9b836e1b14 (patch)
treeb9e6925825700ce4bd0ffaade18387a037dee361 /distrib
parent875d81686362f6e82e41cb667b3071be18349d99 (diff)
Avoid malloc(3) calls in signal handler
Fetch aborts through SIGINT (^C) print a message with fputs(3), but this calls malloc() on its own, which is not supported from interrupt handler context. Fix it by using write(2) which avoids further memory allocations. While here, merge abortfile() into the identical aborthttp() with a more generic "fetch aborted." message for simplicity. Spotted with vm.malloc_conf=SU and ^C on a port's "make fetch" causing ftp(49660) in malloc(): recursive call Abort trap (core dumped) OK jca (who came up with using write(2) independently)
Diffstat (limited to 'distrib')
0 files changed, 0 insertions, 0 deletions