Fix some of the tests for MinGW and fix the use of Sleep/usleep for MinGW & MSVC platforms
* Sleep takes ms, not s * Use sleep/Sleep rather than usleep in the cdchange sample, as usleep is not available on recent MinGW platforms From pbatard branch.
This commit is contained in:
@@ -47,6 +47,14 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
#include <windows.h>
|
||||
#include <direct.h> /* _mkdir */
|
||||
/* MinGW, MSVC do not have symlink */
|
||||
#define symlink(oldpath, newpath) CopyFileA(oldpath, newpath, FALSE)
|
||||
#else
|
||||
#define _mkdir(a) mkdir(a, S_IRWXU)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ERRNO_H
|
||||
# include <errno.h>
|
||||
@@ -102,7 +110,7 @@ main(int argc, const char *argv[])
|
||||
exit(77);
|
||||
}
|
||||
|
||||
if (-1 == check_rc(mkdir(psz_tmp_subdir, 0700),
|
||||
if (-1 == check_rc(_mkdir(psz_tmp_subdir),
|
||||
"mkdir", psz_tmp_subdir))
|
||||
exit(77);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user