]> Dogcows Code - chaz/tint2/blobdiff - src/util/common.c
*fix* execute an external command by calling fork/execl and do not ignore SIGCHLD...
[chaz/tint2] / src / util / common.c
index 545a6be6e29689b723c9846f444dbc364c9afa61..629d29c52f1de297d1e6b039ea1904b2b399c4f5 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-
+#include <unistd.h>
 
 #include "common.h"
 #include "../server.h"
@@ -77,6 +77,23 @@ int parse_line (const char *line, char **key, char **value)
 }
 
 
+void tint_exec(const char *command)
+{
+       if (command) {
+               pid_t pid;
+               pid = fork();
+               if (pid == 0) {
+                       // change for the fork the signal mask
+//                     sigset_t sigset;
+//                     sigprocmask(SIG_SETMASK, &sigset, 0);
+//                     sigprocmask(SIG_UNBLOCK, &sigset, 0);
+                       execl("/bin/sh", "/bin/sh", "-c", command, NULL);
+                       _exit(0);
+               }
+       }
+}
+
+
 int hex_char_to_int (char c)
 {
        int r;
This page took 0.025568 seconds and 4 git commands to generate.