aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder/dirut.cpp
diff options
context:
space:
mode:
authorsomov <somov@yandex-team.ru>2022-02-10 16:45:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:49 +0300
commit7489e4682331202b9c7d863c0898eb83d7b12c2b (patch)
tree9142afc54d335ea52910662635b898e79e192e49 /util/folder/dirut.cpp
parenta5950576e397b1909261050b8c7da16db58f10b1 (diff)
downloadydb-7489e4682331202b9c7d863c0898eb83d7b12c2b.tar.gz
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/folder/dirut.cpp')
-rw-r--r--util/folder/dirut.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/folder/dirut.cpp b/util/folder/dirut.cpp
index 690c980c8bb..ffc9b09f967 100644
--- a/util/folder/dirut.cpp
+++ b/util/folder/dirut.cpp
@@ -425,17 +425,17 @@ TString RealLocation(const TString& path) {
int MakeTempDir(char path[/*FILENAME_MAX*/], const char* prefix) {
int ret;
-
+
TString sysTmp;
-
+
#ifdef _win32_
- if (!prefix || *prefix == '/') {
+ if (!prefix || *prefix == '/') {
#else
- if (!prefix) {
+ if (!prefix) {
#endif
- sysTmp = GetSystemTempDir();
+ sysTmp = GetSystemTempDir();
prefix = sysTmp.data();
- }
+ }
if ((ret = ResolvePath(prefix, nullptr, path, 1)) != 0)
return ret;
@@ -507,19 +507,19 @@ const char* GetFileNameComponent(const char* f) {
TString GetSystemTempDir() {
#ifdef _win_
- char buffer[1024];
- DWORD size = GetTempPath(1024, buffer);
- if (!size) {
- ythrow TSystemError() << "failed to get system temporary directory";
- }
+ char buffer[1024];
+ DWORD size = GetTempPath(1024, buffer);
+ if (!size) {
+ ythrow TSystemError() << "failed to get system temporary directory";
+ }
return TString(buffer, size);
#else
const char* var = "TMPDIR";
const char* def = "/tmp";
const char* r = getenv(var);
const char* result = r ? r : def;
- return result[0] == '/' ? result : ResolveDir(result);
-#endif
+ return result[0] == '/' ? result : ResolveDir(result);
+#endif
}
TString ResolveDir(const char* path) {