commit 256cbdbeb8582f19f4a854967464ee67eeb3c338
parent 5d1c8343c174601eb785d32756f94caa07d09beb
Author: afify <hassan@afify.dev>
Date: Sat, 22 May 2021 08:51:11 +0300
[remove] spawn stderr to /dev/null
- could be a patch
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sfm.c b/sfm.c
@@ -1119,7 +1119,7 @@ frules(char *ex)
static int
spawn(const void *v, char *fn)
{
- int ws, x, argc, fd;
+ int ws, x, argc;
pid_t pid, r;
x = 0;
@@ -1141,11 +1141,8 @@ spawn(const void *v, char *fn)
case -1:
return -1;
case 0:
- fd = open("/dev/null", O_WRONLY);
- dup2(fd, STDERR_FILENO);
execvp(argv[0], argv);
exit(EXIT_SUCCESS);
- close(fd);
default:
while ((r = waitpid(pid, &ws, 0)) == -1 && errno == EINTR)
continue;