diff options
author | Vicent Marti <vicent@github.com> | 2014-01-31 13:57:41 -0800 |
---|---|---|
committer | Vicent Marti <vicent@github.com> | 2014-01-31 13:57:41 -0800 |
commit | 40e10630cfbdddd878a6347c1751092bab7f7a28 (patch) | |
tree | 703103c61035fd79c686b706a30da4b0d0c9f98e | |
parent | f9500b4524c62a2f443061bacea8171b435230f6 (diff) | |
parent | 7be88b4c4df34e91213a8a66d80ef1eb4b3a02ee (diff) | |
download | libgit2-40e10630cfbdddd878a6347c1751092bab7f7a28.tar.gz |
Merge pull request #2092 from libgit2/rb/update-clar
Update to latest clar
-rw-r--r-- | tests/clar/fs.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/clar/fs.h b/tests/clar/fs.h index b7a1ff9d2..7c7dde6fc 100644 --- a/tests/clar/fs.h +++ b/tests/clar/fs.h @@ -12,7 +12,7 @@ #endif /* __MINGW32__ */ -static int +static int fs__dotordotdot(WCHAR *_tocheck) { return _tocheck[0] == '.' && @@ -201,7 +201,7 @@ fs_copy(const char *_source, const char *_dest) DWORD source_attrs, dest_attrs; HANDLE find_handle; WIN32_FIND_DATAW find_data; - + /* The input paths are UTF-8. Convert them to wide characters * for use with the Windows API. */ cl_assert(MultiByteToWideChar(CP_UTF8, @@ -251,17 +251,22 @@ cl_fs_cleanup(void) } #else + +#include <errno.h> +#include <string.h> + static int shell_out(char * const argv[]) { - int status; + int status, piderr; pid_t pid; pid = fork(); if (pid < 0) { fprintf(stderr, - "System error: `fork()` call failed.\n"); + "System error: `fork()` call failed (%d) - %s\n", + errno, strerror(errno)); exit(-1); } @@ -269,7 +274,10 @@ shell_out(char * const 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); } |