do not catch SIGTERM
On SIGTERM pacman was exiting immediately, even in the middle of a transaction. In this case we should leave the lock file in place as an indication that the database may not be in a consistent state. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
7fb8a299c2
commit
85508b478e
1 changed files with 2 additions and 3 deletions
|
@ -334,8 +334,7 @@ static void handler(int signum)
|
||||||
columns_cache_reset();
|
columns_cache_reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* SIGINT/SIGHUP: no committing transaction, release it now and then exit pacman
|
/* SIGINT/SIGHUP: no committing transaction, release it now and then exit pacman */
|
||||||
* SIGTERM: release no matter what */
|
|
||||||
alpm_unlock(config->handle);
|
alpm_unlock(config->handle);
|
||||||
/* output a newline to be sure we clear any line we may be on */
|
/* output a newline to be sure we clear any line we may be on */
|
||||||
xwrite(out, "\n", 1);
|
xwrite(out, "\n", 1);
|
||||||
|
@ -1138,7 +1137,7 @@ int main(int argc, char *argv[])
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
size_t i;
|
size_t i;
|
||||||
struct sigaction new_action, old_action;
|
struct sigaction new_action, old_action;
|
||||||
const int signals[] = { SIGHUP, SIGINT, SIGTERM, SIGSEGV, SIGWINCH };
|
const int signals[] = { SIGHUP, SIGINT, SIGSEGV, SIGWINCH };
|
||||||
uid_t myuid = getuid();
|
uid_t myuid = getuid();
|
||||||
|
|
||||||
/* Set signal handlers */
|
/* Set signal handlers */
|
||||||
|
|
Loading…
Add table
Reference in a new issue