summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7b01c47)
Make sure that sm-notify really runs only once per reboot.
Signed-off-by: Neil Brown <neilb@suse.de>
}
if (strcmp(_SM_BASE_PATH, BASEDIR) == 0) {
}
if (strcmp(_SM_BASE_PATH, BASEDIR) == 0) {
- if (record_pid() == 0 && force == 0 && opt_update_state == 0)
+ if (record_pid() == 0 && force == 0 && opt_update_state == 1)
/* already run, don't try again */
exit(0);
}
/* already run, don't try again */
exit(0);
}
snprintf(pid, 20, "%d\n", getpid());
fd = open("/var/run/sm-notify.pid", O_CREAT|O_EXCL|O_WRONLY, 0600);
snprintf(pid, 20, "%d\n", getpid());
fd = open("/var/run/sm-notify.pid", O_CREAT|O_EXCL|O_WRONLY, 0600);
return 0;
write(fd, pid, strlen(pid));
close(fd);
return 0;
write(fd, pid, strlen(pid));
close(fd);