diff options
author | kakabba <kakabba@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
commit | c8e3995898c443e78266f7420aac5fb3da15d413 (patch) | |
tree | a530e068cc107e227deccc80722204db63a4d75d /util | |
parent | 110a978b66fe6c0916572df51cfead2a9b647174 (diff) | |
download | ydb-c8e3995898c443e78266f7420aac5fb3da15d413.tar.gz |
Restoring authorship annotation for <kakabba@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/folder/dirut.cpp | 14 | ||||
-rw-r--r-- | util/folder/path.cpp | 24 | ||||
-rw-r--r-- | util/folder/path.h | 4 | ||||
-rw-r--r-- | util/folder/path_ut.cpp | 4 | ||||
-rw-r--r-- | util/network/sock.h | 8 | ||||
-rw-r--r-- | util/system/context_aarch64.S | 24 | ||||
-rw-r--r-- | util/system/platform.h | 4 | ||||
-rw-r--r-- | util/system/tls.h | 2 | ||||
-rw-r--r-- | util/system/types.h | 8 | ||||
-rw-r--r-- | util/ya.make | 2 |
10 files changed, 47 insertions, 47 deletions
diff --git a/util/folder/dirut.cpp b/util/folder/dirut.cpp index ffc9b09f96..1c261c9dd7 100644 --- a/util/folder/dirut.cpp +++ b/util/folder/dirut.cpp @@ -399,9 +399,9 @@ int mkpath(char* path, int mode) { return NFs::MakeDirectoryRecursive(path, NFs::EFilePermission(mode)) ? 0 : -1; } -// Implementation of realpath in FreeBSD (version 9.0 and less) and GetFullPathName in Windows -// did not require last component of the file name to exist (other implementations will fail -// if it does not). Use RealLocation if that behaviour is required. +// Implementation of realpath in FreeBSD (version 9.0 and less) and GetFullPathName in Windows +// did not require last component of the file name to exist (other implementations will fail +// if it does not). Use RealLocation if that behaviour is required. TString RealPath(const TString& path) { TTempBuf result; Y_ASSERT(result.Size() > MAX_PATH); //TMP_BUF_LEN > MAX_PATH @@ -416,13 +416,13 @@ TString RealPath(const TString& path) { TString RealLocation(const TString& path) { if (NFs::Exists(path)) - return RealPath(path); + return RealPath(path); TString dirpath = GetDirName(path); if (NFs::Exists(dirpath)) return RealPath(dirpath) + GetDirectorySeparatorS() + GetFileNameComponent(path.data()); - ythrow TFileError() << "RealLocation failed \"" << path << "\""; -} - + ythrow TFileError() << "RealLocation failed \"" << path << "\""; +} + int MakeTempDir(char path[/*FILENAME_MAX*/], const char* prefix) { int ret; diff --git a/util/folder/path.cpp b/util/folder/path.cpp index bfe0c67d68..c8f440d669 100644 --- a/util/folder/path.cpp +++ b/util/folder/path.cpp @@ -77,29 +77,29 @@ TFsPath TFsPath::RelativeTo(const TFsPath& root) const { return TFsPath(split.Reconstruct()); } -TFsPath TFsPath::RelativePath(const TFsPath& root) const { - TSplit split = GetSplit(); - const TSplit& rsplit = root.GetSplit(); - size_t cnt = 0; +TFsPath TFsPath::RelativePath(const TFsPath& root) const { + TSplit split = GetSplit(); + const TSplit& rsplit = root.GetSplit(); + size_t cnt = 0; while (split.size() > cnt && rsplit.size() > cnt && split[cnt] == rsplit[cnt]) { ++cnt; } bool absboth = split.IsAbsolute && rsplit.IsAbsolute; if (cnt == 0 && !absboth) { - ythrow TIoException() << "No common parts in " << *this << " and " << root; + ythrow TIoException() << "No common parts in " << *this << " and " << root; } TString r; for (size_t i = 0; i < rsplit.size() - cnt; i++) { - r += i == 0 ? ".." : "/.."; + r += i == 0 ? ".." : "/.."; } for (size_t i = cnt; i < split.size(); i++) { r += (i == 0 || i == cnt && rsplit.size() - cnt == 0 ? "" : "/"); r += split[i]; } return r.size() ? TFsPath(r) : TFsPath(); -} - +} + TFsPath TFsPath::Parent() const { if (!IsDefined()) { return TFsPath(); @@ -314,11 +314,11 @@ TFsPath TFsPath::RealPath() const { return ::RealPath(*this); } -TFsPath TFsPath::RealLocation() const { - CheckDefined(); +TFsPath TFsPath::RealLocation() const { + CheckDefined(); return ::RealLocation(*this); -} - +} + TFsPath TFsPath::ReadLink() const { CheckDefined(); diff --git a/util/folder/path.h b/util/folder/path.h index 2fb4d6b4ef..68a03bd85e 100644 --- a/util/folder/path.h +++ b/util/folder/path.h @@ -119,7 +119,7 @@ public: /** * @returns relative path or empty path if root equals to this. */ - TFsPath RelativePath(const TFsPath& root) const; //..; for relative paths 1st component must be the same + TFsPath RelativePath(const TFsPath& root) const; //..; for relative paths 1st component must be the same /** * Never fails. Returns this if already a root. @@ -191,7 +191,7 @@ public: void Touch() const; TFsPath RealPath() const; - TFsPath RealLocation() const; + TFsPath RealLocation() const; TFsPath ReadLink() const; /// always absolute diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp index e6a3451016..1d6ce221aa 100644 --- a/util/folder/path_ut.cpp +++ b/util/folder/path_ut.cpp @@ -266,7 +266,7 @@ Y_UNIT_TEST_SUITE(TFsPathTests) { Y_UNIT_TEST(Cwd) { UNIT_ASSERT_VALUES_EQUAL(TFsPath::Cwd().RealPath(), TFsPath(".").RealPath()); } - + Y_UNIT_TEST(TestSubpathOf) { UNIT_ASSERT(TFsPath("/a/b/c/d").IsSubpathOf("/a/b")); @@ -344,7 +344,7 @@ Y_UNIT_TEST_SUITE(TFsPathTests) { UNIT_ASSERT_EXCEPTION(TFsPath("a/b/c").RelativePath(TFsPath("d/e")), TIoException); } - + Y_UNIT_TEST(TestUndefined) { UNIT_ASSERT_VALUES_EQUAL(TFsPath(), TFsPath("")); UNIT_ASSERT_VALUES_EQUAL(TFsPath(), TFsPath().Fix()); diff --git a/util/network/sock.h b/util/network/sock.h index b10be2f715..5db2ee1091 100644 --- a/util/network/sock.h +++ b/util/network/sock.h @@ -251,10 +251,10 @@ struct TSockAddrInet: public sockaddr_in, public ISockAddr { if (ret < 0) return -errno; - socklen_t len = Len(); - if (getsockname(s, (struct sockaddr*)(SockAddr()), &len) < 0) - return -WSAGetLastError(); - + socklen_t len = Len(); + if (getsockname(s, (struct sockaddr*)(SockAddr()), &len) < 0) + return -WSAGetLastError(); + return 0; } diff --git a/util/system/context_aarch64.S b/util/system/context_aarch64.S index 0b2ef4e4a6..e88f6d150f 100644 --- a/util/system/context_aarch64.S +++ b/util/system/context_aarch64.S @@ -1,12 +1,12 @@ .p2align 2 -#if !(defined __darwin__) && !(defined __arm64__) +#if !(defined __darwin__) && !(defined __arm64__) .global __mysetjmp .type __mysetjmp,@function -__mysetjmp: -#else -.global ___mysetjmp -___mysetjmp: -#endif +__mysetjmp: +#else +.global ___mysetjmp +___mysetjmp: +#endif // IHI0055B_aapcs64.pdf 5.1.1, 5.1.2 callee saved registers stp x19, x20, [x0,#0] stp x21, x22, [x0,#16] @@ -24,14 +24,14 @@ ___mysetjmp: ret .p2align 2 -#if !(defined __darwin__) && !(defined __arm64__) +#if !(defined __darwin__) && !(defined __arm64__) .global __mylongjmp .type __mylongjump,@function -__mylongjmp: -#else -.global ___mylongjmp -___mylongjmp: -#endif +__mylongjmp: +#else +.global ___mylongjmp +___mylongjmp: +#endif // IHI0055B_aapcs64.pdf 5.1.1, 5.1.2 callee saved registers ldp x19, x20, [x0,#0] ldp x21, x22, [x0,#16] diff --git a/util/system/platform.h b/util/system/platform.h index 58f310ab34..bfa68216a4 100644 --- a/util/system/platform.h +++ b/util/system/platform.h @@ -93,8 +93,8 @@ #if defined(__i386__) || defined(_M_IX86) #define _i386_ -#endif - +#endif + #if defined(__ia64__) || defined(_M_IA64) #define _ia64_ #endif diff --git a/util/system/tls.h b/util/system/tls.h index 3c4f56dbeb..8f5efdfe34 100644 --- a/util/system/tls.h +++ b/util/system/tls.h @@ -9,7 +9,7 @@ #if defined(_darwin_) #define Y_DISABLE_THRKEY_OPTIMIZATION -#endif +#endif #if defined(_arm_) && defined(_linux_) #define Y_DISABLE_THRKEY_OPTIMIZATION diff --git a/util/system/types.h b/util/system/types.h index 12e68a6060..66064082ac 100644 --- a/util/system/types.h +++ b/util/system/types.h @@ -22,13 +22,13 @@ typedef uint32_t ui32; typedef int32_t i32; #endif -#if defined(_darwin_) && defined(_64_) -typedef unsigned long ui64; +#if defined(_darwin_) && defined(_64_) +typedef unsigned long ui64; typedef long i64; -#else +#else typedef uint64_t ui64; typedef int64_t i64; -#endif +#endif #define LL(number) INT64_C(number) #define ULL(number) UINT64_C(number) diff --git a/util/ya.make b/util/ya.make index 6ebe7e40cf..d41cd64324 100644 --- a/util/ya.make +++ b/util/ya.make @@ -340,7 +340,7 @@ ELSE() system/context_x86.asm ) ENDIF() - IF (ARCH_AARCH64 OR ARCH_ARM64) + IF (ARCH_AARCH64 OR ARCH_ARM64) SRCS( system/context_aarch64.S ) |