diff options
author | akhropov <akhropov@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
commit | 00afc96e9c0298054b7386fa7fb9e3cc3d67b974 (patch) | |
tree | cb7a9f4a92c0d4cc5a86eeed49ad71e810953c1f /util/system/mktemp_system.cpp | |
parent | 83a8efcf3af051e3dd59c00d1d5dafc96412ec1e (diff) | |
download | ydb-00afc96e9c0298054b7386fa7fb9e3cc3d67b974.tar.gz |
Restoring authorship annotation for <akhropov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/mktemp_system.cpp')
-rw-r--r-- | util/system/mktemp_system.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/util/system/mktemp_system.cpp b/util/system/mktemp_system.cpp index 32bea2987c..03a16254a4 100644 --- a/util/system/mktemp_system.cpp +++ b/util/system/mktemp_system.cpp @@ -41,13 +41,13 @@ #include <string.h> #include <ctype.h> -#ifdef _win32_ +#ifdef _win32_ #include "winint.h" #include <util/folder/dirut.h> #else - #include <unistd.h> -#endif - + #include <unistd.h> +#endif + #include <util/random/random.h> #include "sysstat.h" @@ -59,10 +59,10 @@ GetTemp(char* path, int* doopen, int domkdir, int slen) { char *start, *trv, *suffp; char* pad; -#ifndef _win32_ +#ifndef _win32_ struct stat sbuf; int rval; -#endif +#endif ui32 rand; if (doopen != nullptr && domkdir) { @@ -95,7 +95,7 @@ GetTemp(char* path, int* doopen, int domkdir, int slen) for (; trv > path; --trv) { if (*trv == '/') { *trv = '\0'; -#ifdef _win32_ +#ifdef _win32_ ui32 attr = ::GetFileAttributesA(path); *trv = '/'; if (attr == 0xFFFFFFFF) @@ -104,7 +104,7 @@ GetTemp(char* path, int* doopen, int domkdir, int slen) errno = ENOTDIR; return (0); } -#else +#else rval = stat(path, &sbuf); *trv = '/'; if (rval != 0) { @@ -114,7 +114,7 @@ GetTemp(char* path, int* doopen, int domkdir, int slen) errno = ENOTDIR; return (0); } -#endif +#endif break; } } @@ -137,14 +137,14 @@ GetTemp(char* path, int* doopen, int domkdir, int slen) return (0); } } else -#ifdef _win32_ +#ifdef _win32_ if (::GetFileAttributesA(path) == INVALID_FILE_ATTRIBUTES) return (errno == ENOENT); -#else +#else if (lstat(path, &sbuf)) { return (errno == ENOENT); } -#endif +#endif /* If we have a collision, cycle through the space of filenames */ for (trv = start;;) { if (*trv == '\0' || trv == suffp) { |