]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/quotacheck/quotacheck.c
util-lib: split our string related calls from util.[ch] into its own file string...
[thirdparty/systemd.git] / src / quotacheck / quotacheck.c
index a729f592cf3e95a10c93921842aa7c3e60d68ee3..a2a035f4f1e92eb5f658d8f69d9d07a72015a0df 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <stdbool.h>
 #include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/prctl.h>
 #include <unistd.h>
 
-#include "util.h"
 #include "process-util.h"
+#include "signal-util.h"
+#include "string-util.h"
+#include "util.h"
 
 static bool arg_skip = false;
 static bool arg_force = false;
@@ -105,7 +108,13 @@ int main(int argc, char *argv[]) {
                 log_error_errno(errno, "fork(): %m");
                 return EXIT_FAILURE;
         } else if (pid == 0) {
+
                 /* Child */
+
+                (void) reset_all_signal_handlers();
+                (void) reset_signal_mask();
+                assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0);
+
                 execv(cmdline[0], (char**) cmdline);
                 _exit(1); /* Operational error */
         }