commit - 46be108faf24f180cc05a66d874d9a449472d817
commit + 4d9042b347e757448bd0dff60537fe57e1af5ad1
blob - bc5756e623d51979c01828389337089965f782a8
blob + b581bbe3e8fc97d4d3215bc948d761fa9c4135e9
--- lib/fetch.c
+++ lib/fetch.c
return error;
} else if (pid == 0) {
int n;
- close(pfd[1]);
- dup2(pfd[0], 0);
- dup2(pfd[0], 1);
+ if (close(pfd[1]) == -1)
+ err(1, "close");
+ if (dup2(pfd[0], 0) == -1)
+ err(1, "dup2");
+ if (dup2(pfd[0], 1) == -1)
+ err(1, "dup2");
n = snprintf(cmd, sizeof(cmd), "git-%s-pack", direction);
if (n < 0 || n >= ssizeof(cmd))
err(1, "snprintf");
if (execv(GOT_FETCH_PATH_SSH, argv) == -1)
- err(1, "execl");
+ err(1, "execv");
abort(); /* not reached */
} else {
- close(pfd[0]);
+ if (close(pfd[0]) == -1)
+ return got_error_from_errno("close");
*fetchpid = pid;
*fetchfd = pfd[1];
return NULL;