Commit Diff


commit - e2af4cd74c227f8f647bcb29631fd0cfa70d6358
commit + 6e596ed0f31b4b5a6944bb7a6d3fa433caa69314
blob - 3d131e88f1769fb82e6fbf1a43fb8f7cb2e0a452
blob + 8bab9ebf45502b258b33fe85e4c48fc1643e1e37
--- 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) {