commit a66a4a5063151449b830f5510f00717296fa3c3d from: Mark Jamsek via: Thomas Adam date: Fri Feb 03 15:22:14 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 - 0ac95f6598177311dd7c3f16f1da85854f0437dc commit + a66a4a5063151449b830f5510f00717296fa3c3d blob - 53059582d7c705f7fe29bdb5227476bbceaac22e blob + d9d48662f28e288f700a39e53e8c64c25dd28233 --- 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 - 0b590b2ed3ab03fcf4861934072cbea80aedea25 blob + be67c17be661b6c2d2bfba6a97ffdd68e5dea669 --- 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 - 5c3519f8f414adc10d3f24f30cda57b165000539 blob + 7b059d3b39b9c64f2fe8aeb1be1608f27453c3ac --- lib/object_open_privsep.c +++ lib/object_open_privsep.c @@ -102,7 +102,7 @@ done: close(accumfd); } else pack->child_has_tempfiles = 1; - return NULL; + return err; } static const struct got_error *