mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +03:00
Exit after last unregister_for_event()
This commit is contained in:
parent
21ca3b1227
commit
9e0419057c
@ -100,13 +100,13 @@ int main(int argc, char **argv)
|
||||
if (!parse_argv(argc, argv, &dso_name_arg, &device_arg, ®, &list))
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
if (device_arg){
|
||||
if (device_arg) {
|
||||
if (!(device = strdup(device_arg)))
|
||||
exit(EXIT_FAILURE);
|
||||
} else
|
||||
device = NULL;
|
||||
|
||||
if (dso_name_arg){
|
||||
if (dso_name_arg) {
|
||||
if (!(dso_name = strdup(dso_name_arg)))
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
|
@ -321,14 +321,9 @@ static void unlock(void)
|
||||
/* Check, if a device exists. */
|
||||
static int device_exists(char *device)
|
||||
{
|
||||
int f;
|
||||
struct stat st_buf;
|
||||
|
||||
if ((f = open(device, O_RDONLY)) == -1)
|
||||
return 0;
|
||||
|
||||
close(f);
|
||||
|
||||
return 1;
|
||||
return !stat(device, &st_buf) && S_ISBLK(st_buf.st_mode);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -963,9 +958,10 @@ static void comm_thread(struct fifos *fifos)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Loop forever and handle client requests sequentially. */
|
||||
while (1)
|
||||
/* Exit after last unregister. */
|
||||
do {
|
||||
process_request(fifos, &msg);
|
||||
} while (!list_empty(&thread_registry));
|
||||
}
|
||||
|
||||
/* Fork into the background and detach from our parent process. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user