aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder/dirut.cpp
diff options
context:
space:
mode:
authorsomov <somov@yandex-team.ru>2022-02-10 16:45:47 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:47 +0300
commita5950576e397b1909261050b8c7da16db58f10b1 (patch)
tree7ba7677f6a4c3e19e2cefab34d16df2c8963b4d4 /util/folder/dirut.cpp
parent81eddc8c0b55990194e112b02d127b87d54164a9 (diff)
downloadydb-a5950576e397b1909261050b8c7da16db58f10b1.tar.gz
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 1 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 ffc9b09f96..690c980c8b 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) {