[pacman-dev] Improve locking?

lilydjwg lilydjwg at gmail.com
Sat Feb 20 04:00:40 UTC 2021


I still have issues with leftover lock file. I have some questions:

In pacman.c cleanup function, the signal handler is removed before
unlocking because

> The soft interrupt handler dereferences config, causing a segfault if
> it is called during cleanup.

(commit a8e2578febbb71d1b788c7270c2be57ca1e64dec)

Why wasn't it to check if config is not NULL instead?

Why wasn't flock used? I mean, in addition to current lock mechanism,
flock the file. I know flock doesn't work for a couple of places (NFS,
non-Linux, etc), but if it works for someone's situation, it would help
a lot.

Thanks in advance.

-- 
Best regards,
lilydjwg


More information about the pacman-dev mailing list