]> git.ipfire.org Git - thirdparty/git.git/blobdiff - compat/mingw.c
Merge branch 'js/lstat-mingw-enotdir-fix'
[thirdparty/git.git] / compat / mingw.c
index 77471d9a22755efbf16b2e1f2b5dbfa44e92426b..c5ca4eb4a9a9263777a8b2285d047a3850fd6289 100644 (file)
@@ -1059,10 +1059,7 @@ char *mingw_mktemp(char *template)
 
 int mkstemp(char *template)
 {
-       char *filename = mktemp(template);
-       if (filename == NULL)
-               return -1;
-       return open(filename, O_RDWR | O_CREAT, 0600);
+       return git_mkstemp_mode(template, 0600);
 }
 
 int gettimeofday(struct timeval *tv, void *tz)
@@ -2332,7 +2329,7 @@ int setitimer(int type, struct itimerval *in, struct itimerval *out)
        static const struct timeval zero;
        static int atexit_done;
 
-       if (out != NULL)
+       if (out)
                return errno = EINVAL,
                        error("setitimer param 3 != NULL not implemented");
        if (!is_timeval_eq(&in->it_interval, &zero) &&
@@ -2361,7 +2358,7 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out)
        if (sig != SIGALRM)
                return errno = EINVAL,
                        error("sigaction only implemented for SIGALRM");
-       if (out != NULL)
+       if (out)
                return errno = EINVAL,
                        error("sigaction: param 3 != NULL not implemented");
 
@@ -2830,7 +2827,7 @@ not_a_reserved_name:
                        }
 
                        c = path[i];
-                       if (c && c != '.' && c != ':' && c != '/' && c != '\\')
+                       if (c && c != '.' && c != ':' && !is_xplatform_dir_sep(c))
                                goto not_a_reserved_name;
 
                        /* contains reserved name */