1
0
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:
Heinz Mauelshagen 2005-05-20 13:53:26 +00:00
parent 21ca3b1227
commit 9e0419057c
2 changed files with 7 additions and 11 deletions

View File

@ -100,13 +100,13 @@ int main(int argc, char **argv)
if (!parse_argv(argc, argv, &dso_name_arg, &device_arg, &reg, &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 {

View File

@ -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. */