]> granicus.if.org Git - procps-ng/commit
top: In the bye_bye function, replace fputs with the write interface.
authorShaohua Zhan <shaohua.zhan@windriver.com>
Thu, 3 Dec 2020 02:24:09 +0000 (10:24 +0800)
committerShaohua Zhan <shaohua.zhan@windriver.com>
Thu, 18 Mar 2021 07:46:46 +0000 (15:46 +0800)
commit0bf15c004db6a3342703a3c420a5692e376c457d
tree332fe62aacbf18eb99618634650de8a2aeed31f4
parent52afb3a8d31871d28b1c39573a7ed5196c2d5023
top: In the bye_bye function, replace fputs with the write interface.

When top calls malloc, if a signal is received, it will
call sig_endpgm to process the signal. In the bye_bye function, if the
-b option is enable, the Batch variable is set, the fputs function
will calls malloc at the same time. The malloc function is not reentrant, so
it will cause the program to crash.

Signed-off-by: Shaohua Zhan <shaohua.zhan@windriver.com>
top/top.c