From aa816c309b268504db04e48e5e9f328398428427 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 12 Oct 2021 22:48:33 +0200 Subject: misc --- src/program.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/program.c') diff --git a/src/program.c b/src/program.c index 00f242b..56f65c1 100644 --- a/src/program.c +++ b/src/program.c @@ -27,9 +27,8 @@ static int program_read_output(int process_id, int read_fd, ProgramOutputCallbac if(bytes_read == 0) { break; } else if(bytes_read == -1) { - int err = errno; - fprintf(stderr, "Failed to read from pipe, error: %s\n", strerror(err)); - return -err; + fprintf(stderr, "Failed to read from pipe, error: %s\n", strerror(errno)); + return -1; } buffer[bytes_read] = '\0'; @@ -141,7 +140,7 @@ int program_exec_async(const char **args, int *process_id, int *stdin_file, int pid_t pid = fork(); if(pid == -1) { - result = -errno; + result = -1; perror("failed to fork"); goto cleanup; } else if(pid == 0) { /* child */ -- cgit v1.2.3