commit c33c3763d3c9e005bb51d9d3a6aab3bedc50bf2e from: Mark Jamsek date: Fri Feb 03 10:15:47 2023 UTC fix mistaken instances returning NULL instead of err While here, for consistency, check dup() return value for -1 rather than < 0. ok stsp@ commit - 66d2f9c8151ab2386b1b9369c63d9bbc500243b1 commit + c33c3763d3c9e005bb51d9d3a6aab3bedc50bf2e blob - 8b62a11fd84c9ac104aee2c98521c54f0ea943ec blob + fe66f5fc26c7e236053a98d519915b574179a529 --- got/got.c +++ got/got.c @@ -2088,7 +2088,7 @@ delete_missing_ref(struct got_reference *ref, done: free(id); free(id_str); - return NULL; + return err; } static const struct got_error * blob - 32737552a0cbb8a1adfcfa55e1c79061d1639cfc blob + a2a6ba3a8938088f3b8c6306af7ae41ce8bf181d --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -93,8 +93,8 @@ got_gotweb_dupfd(int *priv_fd, int *fd) { *fd = dup(*priv_fd); - if (*fd < 0) - return NULL; + if (*fd == -1) + return got_error_from_errno("dup"); return NULL; } blob - 86db216cc1bca6e3651b62b90bb2d68c238065dd blob + f80d86a8686711ff5888dd6847e0d84b98bc0672 --- lib/object_open_privsep.c +++ lib/object_open_privsep.c @@ -104,7 +104,7 @@ done: close(accumfd); } else pack->child_has_tempfiles = 1; - return NULL; + return err; } static const struct got_error *