aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/mktemp.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/system/mktemp.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/mktemp.cpp')
-rw-r--r--util/system/mktemp.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/util/system/mktemp.cpp b/util/system/mktemp.cpp
index 505b7b4a4b..188fb1c7ea 100644
--- a/util/system/mktemp.cpp
+++ b/util/system/mktemp.cpp
@@ -1,22 +1,22 @@
#include "tempfile.h"
-
+
#include <util/folder/dirut.h>
#include <util/generic/yexception.h>
-#include <util/stream/file.h>
-
+#include <util/stream/file.h>
+
#include <cerrno>
#include <cstring>
#ifdef _win32_
- #include "winint.h"
- #include <io.h>
+ #include "winint.h"
+ #include <io.h>
#else
- #include <unistd.h>
- #include <stdlib.h>
+ #include <unistd.h>
+ #include <stdlib.h>
#endif
-extern "C" int mkstemps(char* path, int slen);
-
+extern "C" int mkstemps(char* path, int slen);
+
TString MakeTempName(const char* wrkDir, const char* prefix, const char* extension) {
#ifndef _win32_
TString filePath;
@@ -29,11 +29,11 @@ TString MakeTempName(const char* wrkDir, const char* prefix, const char* extensi
if (filePath.back() != '/') {
filePath += '/';
- }
+ }
if (prefix) {
filePath += prefix;
- }
+ }
filePath += "XXXXXX"; // mkstemps requirement
@@ -45,7 +45,7 @@ TString MakeTempName(const char* wrkDir, const char* prefix, const char* extensi
}
filePath += extension;
extensionPartLength += strlen(extension);
- }
+ }
int fd = mkstemps(const_cast<char*>(filePath.data()), extensionPartLength);
if (fd >= 0) {
@@ -55,7 +55,7 @@ TString MakeTempName(const char* wrkDir, const char* prefix, const char* extensi
#else
char tmpDir[MAX_PATH + 1]; // +1 -- for terminating null character
char filePath[MAX_PATH];
- const char* pDir = 0;
+ const char* pDir = 0;
if (wrkDir && *wrkDir) {
pDir = wrkDir;
@@ -68,6 +68,6 @@ TString MakeTempName(const char* wrkDir, const char* prefix, const char* extensi
return filePath;
}
#endif
-
+
ythrow TSystemError() << "can not create temp name(" << wrkDir << ", " << prefix << ", " << extension << ")";
-}
+}