aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shared.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/shared.c b/shared.c
index 4369378..919a99e 100644
--- a/shared.c
+++ b/shared.c
@@ -15,21 +15,21 @@ struct cgit_context ctx;
15int chk_zero(int result, char *msg) 15int 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
22int chk_positive(int result, char *msg) 22int 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
29int chk_non_negative(int result, char *msg) 29int 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),