diff options
Diffstat (limited to 'libbb/platform.c')
-rw-r--r-- | libbb/platform.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/platform.c b/libbb/platform.c index 03bbb798b..329b0237e 100644 --- a/libbb/platform.c +++ b/libbb/platform.c | |||
@@ -27,7 +27,6 @@ int FAST_FUNC usleep(unsigned usec) | |||
27 | * If a signal has non-default handler, nanosleep returns early. | 27 | * If a signal has non-default handler, nanosleep returns early. |
28 | * Our version of usleep doesn't return early | 28 | * Our version of usleep doesn't return early |
29 | * if interrupted by such signals: | 29 | * if interrupted by such signals: |
30 | * | ||
31 | */ | 30 | */ |
32 | while (nanosleep(&ts, &ts) != 0) | 31 | while (nanosleep(&ts, &ts) != 0) |
33 | continue; | 32 | continue; |
@@ -107,7 +106,8 @@ void* FAST_FUNC memrchr(const void *s, int c, size_t n) | |||
107 | /* This is now actually part of POSIX.1, but was only added in 2008 */ | 106 | /* This is now actually part of POSIX.1, but was only added in 2008 */ |
108 | char* FAST_FUNC mkdtemp(char *template) | 107 | char* FAST_FUNC mkdtemp(char *template) |
109 | { | 108 | { |
110 | if (mktemp(template) == NULL || mkdir(template, 0700) != 0) | 109 | /* NB: on error, mktemp returns an empty string, not NULL */ |
110 | if (mktemp(template)[0] == '\0' || mkdir(template, 0700) != 0) | ||
111 | return NULL; | 111 | return NULL; |
112 | return template; | 112 | return template; |
113 | } | 113 | } |