aboutsummaryrefslogtreecommitdiffstats
path: root/src/tipideed
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-10-26 15:00:30 +0000
committerLaurent Bercot <ska@appnovation.com>2023-10-26 15:00:30 +0000
commitd05b3963381a4cd0329bced938d79a23bb392658 (patch)
tree0033b18d74eb24b497d7e258b85e7c7093541d2b /src/tipideed
parent3dd236a9d8ff1fa0a754b359ceda12e85a123fff (diff)
downloadtipidee-d05b3963381a4cd0329bced938d79a23bb392658.tar.gz
Some more fixes
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tipideed')
-rw-r--r--src/tipideed/cgi.c4
-rw-r--r--src/tipideed/responses.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/tipideed/cgi.c b/src/tipideed/cgi.c
index 037076d..9751911 100644
--- a/src/tipideed/cgi.c
+++ b/src/tipideed/cgi.c
@@ -124,10 +124,10 @@ static inline int do_nph (tipidee_rql const *rql, char const *docroot, char cons
PROG = progstr ;
tain_add_g(&deadline, &g.cgitto) ;
close(p[0]) ;
- if (ndelay_on(p[1]) == -1) strerr_diefu1sys(111, "set fd nonblocking") ;
+ if (ndelay_on(p[1]) == -1) die500sys(rql, 111, docroot, "set fd nonblocking") ;
if (buffer_timed_put_g(&b, body, bodylen, &deadline) < bodylen
|| !buffer_timed_flush_g(&b, &deadline))
- strerr_diefu2sys(111, "write request body to nph ", argv[0]) ;
+ die500sys(rql, 111, docroot, "write request body to nph ", argv[0]) ;
_exit(0) ;
}
default : break ;
diff --git a/src/tipideed/responses.c b/src/tipideed/responses.c
index 8155b55..f08f83c 100644
--- a/src/tipideed/responses.c
+++ b/src/tipideed/responses.c
@@ -2,6 +2,7 @@
#include <skalibs/bsdsnowflake.h>
+#include <errno.h>
#include <string.h>
#include <unistd.h>
@@ -103,7 +104,9 @@ void response_error_and_exit (tipidee_rql const *rql, char const *docroot, unsig
void response_error_and_die (tipidee_rql const *rql, int e, char const *docroot, unsigned int status, char const *const *v, unsigned int n, uint32_t options)
{
+ int serr = errno ;
response_error(rql, docroot, status, options | 1) ;
+ errno = serr ;
if (options & 1) strerr_dievsys(e, v, n) ;
else strerr_diev(e, v, n) ;
}