aboutsummaryrefslogtreecommitdiff
path: root/src/Program.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-11 20:59:58 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-11 21:37:10 +0200
commit97df498b30d8580d4b74582a634562f996003dd0 (patch)
treee40bb52d0709e435c66d49126780044ca4c4a3b0 /src/Program.cpp
parent9d71f913744ab567a49195a43c525c0d494fe084 (diff)
Remove dependency on imagemagick. Use stb resize to downscale image.
Diffstat (limited to 'src/Program.cpp')
-rw-r--r--src/Program.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/Program.cpp b/src/Program.cpp
index 5daf25c..513ce8c 100644
--- a/src/Program.cpp
+++ b/src/Program.cpp
@@ -1,7 +1,6 @@
#include "../include/Program.hpp"
#include <unistd.h>
#include <sys/wait.h>
-#include <sys/prctl.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
@@ -94,8 +93,6 @@ int exec_program_pipe(const char **args, ReadProgram *read_program) {
return -2;
}
- pid_t parent_pid = getpid();
-
pid_t pid = vfork();
if(pid == -1) {
perror("Failed to vfork");
@@ -103,15 +100,6 @@ int exec_program_pipe(const char **args, ReadProgram *read_program) {
close(fd[WRITE_END]);
return -3;
} else if(pid == 0) { /* child */
- if(prctl(PR_SET_PDEATHSIG, SIGTERM) == -1) {
- perror("prctl(PR_SET_PDEATHSIG, SIGTERM) failed");
- _exit(127);
- }
-
- /* Test if the parent died before the above call to prctl */
- if(getppid() != parent_pid)
- _exit(127);
-
dup2(fd[WRITE_END], STDOUT_FILENO);
close(fd[READ_END]);
close(fd[WRITE_END]);
@@ -236,8 +224,6 @@ int exec_program_async(const char **args, pid_t *result_process_id) {
if(args[0] == NULL)
return -1;
- pid_t parent_pid = getpid();
-
pid_t pid = vfork();
if(pid == -1) {
int err = errno;
@@ -245,15 +231,6 @@ int exec_program_async(const char **args, pid_t *result_process_id) {
return -err;
} else if(pid == 0) { /* child */
if(result_process_id) {
- if(prctl(PR_SET_PDEATHSIG, SIGTERM) == -1) {
- perror("prctl(PR_SET_PDEATHSIG, SIGTERM) failed");
- _exit(127);
- }
-
- /* Test if the parent died before the above call to prctl */
- if(getppid() != parent_pid)
- _exit(127);
-
execvp(args[0], (char* const*)args);
perror("execvp");
_exit(127);