policycoreutils/restorecond-fedora.patch
Petr Lautrbach c83a9507f0 policycoreutils-2.7-2.fc27
- sepolicy: Fix sepolicy manpage.
- semanage: Update Infiniband code to work on python3
- semanage: Fix export of ibendport entries
- semanage: Enforce noreload only if it's requested by -N option
- semanage: Don't use global setup variable
- semanage: drop *_ini functions
- semanage: Enable listing file_contexts.homedirs
- semanage: make seobject.py backward compatible
- gui: remove mappingsPage
- gui: delete overridden definition of usersPage.delete()
- gui: fix parsing of "semodule -lfull" in tab Modules
- gui: remove the status bar
- sepolicy: support non-MLS policy in gui
- sepolicy: ignore comments and empty lines in file_contexts.subs_dist
- gui: port to Python 3 by migrating to PyGI
- sepolicy: do not fail when file_contexts.local or .subs do not exist
- restorecond: check write() and daemon() results
- sepolicy: remove stray space in section "SEE ALSO"
- sepolicy: support non-MCS policy in manpage
- sepolicy: support non-MLS policy in manpage
- sepolicy: fix misspelling of _ra_content_t suffix
- sepolicy: do not fail when file_contexts.local does not exist
2017-12-14 10:33:28 +01:00

30 lines
734 B
Diff

diff --git restorecond-2.7/restorecond.c restorecond-2.7/restorecond.c
index f379db1..6fbbd35 100644
--- restorecond-2.7/restorecond.c
+++ restorecond-2.7/restorecond.c
@@ -103,7 +103,10 @@ static int write_pid_file(void)
pidfile = 0;
return 1;
}
- (void)write(pidfd, val, (unsigned int)len);
+ if (write(pidfd, val, (unsigned int)len) != len) {
+ syslog(LOG_ERR, "Unable to write to pidfile (%s)", strerror(errno));
+ return 1;
+ }
close(pidfd);
return 0;
}
@@ -204,8 +207,10 @@ int main(int argc, char **argv)
watch_file = server_watch_file;
read_config(master_fd, watch_file);
- if (!debug_mode)
- daemon(0, 0);
+ if (!debug_mode) {
+ if (daemon(0, 0) < 0)
+ exitApp("daemon");
+ }
write_pid_file();