diff options
author | stanly <stanly@yandex-team.ru> | 2022-02-10 16:46:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:49 +0300 |
commit | cde218e65dfef5ce03a48d641fd8f7913cf17b2d (patch) | |
tree | d3349caea4095825a55b5ba24fe758067b29ce6f /util/folder/fts.cpp | |
parent | 9f813499b4ef585cb3c2bb93de93ef003daf4fc4 (diff) | |
download | ydb-cde218e65dfef5ce03a48d641fd8f7913cf17b2d.tar.gz |
Restoring authorship annotation for <stanly@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder/fts.cpp')
-rw-r--r-- | util/folder/fts.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/util/folder/fts.cpp b/util/folder/fts.cpp index 0e6a6f86eb..314e8d6d58 100644 --- a/util/folder/fts.cpp +++ b/util/folder/fts.cpp @@ -215,18 +215,18 @@ static int fts_safe_changedir(FTS*, FTSENT*, int, const char*); #define BNAMES 2 /* yfts_children, names only */ #define BREAD 3 /* yfts_read */ -static u_short -yfts_type_from_info(u_short info) { - if (info == FTS_D || info == FTS_DP || info == FTS_DOT) { - return FTS_D; - } else if (info == FTS_F) { - return FTS_F; - } else if (info == FTS_SL || info == FTS_SLNONE) { - return FTS_SL; - } - return FTS_NSOK; -} - +static u_short +yfts_type_from_info(u_short info) { + if (info == FTS_D || info == FTS_DP || info == FTS_DOT) { + return FTS_D; + } else if (info == FTS_F) { + return FTS_F; + } else if (info == FTS_SL || info == FTS_SLNONE) { + return FTS_SL; + } + return FTS_NSOK; +} + static void* yreallocf(void* ptr, size_t size) { @@ -314,7 +314,7 @@ FTS* yfts_open(char* const* argv, int options, int (*compar)(const FTSENT**, con p->fts_parent = parent; p->fts_accpath = p->fts_name; p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW)); - p->fts_type = yfts_type_from_info(p->fts_info); + p->fts_type = yfts_type_from_info(p->fts_info); /* Command-line "." and ".." are real directories. */ if (p->fts_info == FTS_DOT) { @@ -482,7 +482,7 @@ yfts_read(FTS* sp) { /* Any type of file may be re-visited; re-stat and re-turn. */ if (instr == FTS_AGAIN) { p->fts_info = fts_stat(sp, p, 0); - p->fts_type = yfts_type_from_info(p->fts_info); + p->fts_type = yfts_type_from_info(p->fts_info); return (p); } @@ -495,7 +495,7 @@ yfts_read(FTS* sp) { if (instr == FTS_FOLLOW && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) { p->fts_info = fts_stat(sp, p, 1); - p->fts_type = yfts_type_from_info(p->fts_info); + p->fts_type = yfts_type_from_info(p->fts_info); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { if (valid_dird(p->fts_symfd = get_cwdd())) { p->fts_errno = errno; @@ -591,7 +591,7 @@ next: } if (p->fts_instr == FTS_FOLLOW) { p->fts_info = fts_stat(sp, p, 1); - p->fts_type = yfts_type_from_info(p->fts_info); + p->fts_type = yfts_type_from_info(p->fts_info); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { if (valid_dird(p->fts_symfd = get_cwdd())) { @@ -981,16 +981,16 @@ fts_build(FTS* sp, int type) p->fts_flags |= FTS_ISW; #endif -#ifdef _DIRENT_HAVE_D_TYPE - if (dp->d_type == DT_DIR) { - p->fts_type = FTS_D; - } else if (dp->d_type == DT_REG) { - p->fts_type = FTS_F; - } else if (dp->d_type == DT_LNK) { - p->fts_type = FTS_SL; - } -#endif - +#ifdef _DIRENT_HAVE_D_TYPE + if (dp->d_type == DT_DIR) { + p->fts_type = FTS_D; + } else if (dp->d_type == DT_REG) { + p->fts_type = FTS_F; + } else if (dp->d_type == DT_LNK) { + p->fts_type = FTS_SL; + } +#endif + // coverity[dead_error_line]: false positive if (cderrno) { if (nlinks) { @@ -1019,7 +1019,7 @@ fts_build(FTS* sp, int type) } /* Stat it. */ p->fts_info = fts_stat(sp, p, 0); - p->fts_type = yfts_type_from_info(p->fts_info); + p->fts_type = yfts_type_from_info(p->fts_info); /* Decrement link count if applicable. */ if (nlinks > 0 && (p->fts_info == FTS_D || @@ -1259,7 +1259,7 @@ fts_alloc(FTS* sp, const char* name, int namelen) p->fts_instr = FTS_NOINSTR; p->fts_number = 0; p->fts_pointer = nullptr; - p->fts_type = FTS_NSOK; + p->fts_type = FTS_NSOK; return (p); } |