[pacman-dev] Strange cleanup() function usage in pacman.c

Xavier shiningxc at gmail.com
Sun Mar 9 07:20:01 EDT 2008

On Sun, Mar 09, 2008 at 11:40:48AM +0100, Nagy Gabor wrote:
> Cleanup() is a signal handler. However, we usually pass some return
> values to it manually, see lines 816 and 822 for example.
> Or run pacman -V --debug. (parseargs returns with 2 == SIGINT)
> Is this OK?

Huh yes, all these cleanup calls don't look right..
Well, we only listen to SIGINT 2, SIGTERM 15 and SIGSEGV 11, but still we
shouldn't call cleanup manually with values higher than 0.

What about splitting these two functions :
first part is signal(int signum)
second part is cleanup(int ret)

More information about the pacman-dev mailing list