commit e9d3ad59c92a3ce340f8ac1bd0b0dff75dc3d951 from: Stefan Sperling date: Wed Aug 31 08:02:34 2022 UTC fix dup(2) error checking in got_gotweb_openfile() commit - dd84f50528e78a6c691c9979129f2ee6564bee96 commit + e9d3ad59c92a3ce340f8ac1bd0b0dff75dc3d951 blob - 18c5d080235f613812163295cc01d3632e584e0a blob + 85594b289ee57c52802a8fa7745f70d2a9bb3e77 --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -84,9 +84,8 @@ static const struct got_error * got_gotweb_openfile(FILE **f, int *priv_fd, int *fd) { *fd = dup(*priv_fd); - - if (*fd < 0) - return NULL; + if (*fd == -1) + return got_error_from_errno("dup"); *f = fdopen(*fd, "w+"); if (*f == NULL) {