diff options
-rw-r--r-- | shared.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -15,21 +15,21 @@ struct cgit_context ctx; | |||
15 | int chk_zero(int result, char *msg) | 15 | int chk_zero(int result, char *msg) |
16 | { | 16 | { |
17 | if (result != 0) | 17 | if (result != 0) |
18 | die("%s: %s", msg, strerror(errno)); | 18 | die_errno("%s", msg); |
19 | return result; | 19 | return result; |
20 | } | 20 | } |
21 | 21 | ||
22 | int chk_positive(int result, char *msg) | 22 | int chk_positive(int result, char *msg) |
23 | { | 23 | { |
24 | if (result <= 0) | 24 | if (result <= 0) |
25 | die("%s: %s", msg, strerror(errno)); | 25 | die_errno("%s", msg); |
26 | return result; | 26 | return result; |
27 | } | 27 | } |
28 | 28 | ||
29 | int chk_non_negative(int result, char *msg) | 29 | int chk_non_negative(int result, char *msg) |
30 | { | 30 | { |
31 | if (result < 0) | 31 | if (result < 0) |
32 | die("%s: %s", msg, strerror(errno)); | 32 | die_errno("%s", msg); |
33 | return result; | 33 | return result; |
34 | } | 34 | } |
35 | 35 | ||
@@ -468,8 +468,7 @@ int cgit_open_filter(struct cgit_filter *filter) | |||
468 | chk_non_negative(dup2(filter->pipe_fh[0], STDIN_FILENO), | 468 | chk_non_negative(dup2(filter->pipe_fh[0], STDIN_FILENO), |
469 | "Unable to use pipe as STDIN"); | 469 | "Unable to use pipe as STDIN"); |
470 | execvp(filter->cmd, filter->argv); | 470 | execvp(filter->cmd, filter->argv); |
471 | die("Unable to exec subprocess %s: %s (%d)", filter->cmd, | 471 | die_errno("Unable to exec subprocess %s", filter->cmd); |
472 | strerror(errno), errno); | ||
473 | } | 472 | } |
474 | close(filter->pipe_fh[0]); | 473 | close(filter->pipe_fh[0]); |
475 | chk_non_negative(dup2(filter->pipe_fh[1], STDOUT_FILENO), | 474 | chk_non_negative(dup2(filter->pipe_fh[1], STDOUT_FILENO), |