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

Dan McGee dpmcgee at gmail.com
Sun Mar 9 11:45:40 EDT 2008


On Sun, Mar 9, 2008 at 6:20 AM, Xavier <shiningxc at gmail.com> wrote:
> 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)

+1

-Dan




More information about the pacman-dev mailing list