*fix* execute an external command by calling fork/execl and do not ignore SIGCHLD (maybe fixes issue 263)

git-svn-id: http://tint2.googlecode.com/svn/trunk@480 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
Andreas.Fink85
2010-06-11 18:47:26 +00:00
parent e26cecf664
commit 5521275bef
5 changed files with 28 additions and 18 deletions

View 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;