mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-15 16:51:27 +00:00
Merge pull request #2092 from libgit2/rb/update-clar
Update to latest clar
This commit is contained in:
commit
40e10630cf
@ -251,17 +251,22 @@ cl_fs_cleanup(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
static int
|
static int
|
||||||
shell_out(char * const argv[])
|
shell_out(char * const argv[])
|
||||||
{
|
{
|
||||||
int status;
|
int status, piderr;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"System error: `fork()` call failed.\n");
|
"System error: `fork()` call failed (%d) - %s\n",
|
||||||
|
errno, strerror(errno));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +274,10 @@ shell_out(char * const argv[])
|
|||||||
execv(argv[0], argv);
|
execv(argv[0], argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
waitpid(pid, &status, 0);
|
do {
|
||||||
|
piderr = waitpid(pid, &status, WUNTRACED);
|
||||||
|
} while (piderr < 0 && (errno == EAGAIN || errno == EINTR));
|
||||||
|
|
||||||
return WEXITSTATUS(status);
|
return WEXITSTATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user