Adding upstream version 2.14.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
94a061187a
commit
dbdc28cb89
572 changed files with 4636 additions and 1730 deletions
28
util/sighdl.c
Normal file
28
util/sighdl.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "sighdl.h"
|
||||
|
||||
bool nvme_sigint_received;
|
||||
|
||||
static void nvme_sigint_handler(int signum)
|
||||
{
|
||||
nvme_sigint_received = true;
|
||||
}
|
||||
|
||||
int nvme_install_sigint_handler(void)
|
||||
{
|
||||
struct sigaction act;
|
||||
|
||||
sigemptyset(&act.sa_mask);
|
||||
act.sa_handler = nvme_sigint_handler;
|
||||
act.sa_flags = 0;
|
||||
|
||||
nvme_sigint_received = false;
|
||||
if (sigaction(SIGINT, &act, NULL) == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue