From 8b8d6a24f9d2ddeec9d543e95868e8f0e264c3da Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 1 Feb 2021 13:41:58 +0100 Subject: [PATCH] virfile: Remove redundant #ifndef This section is guarded by "#ifndef WIN32" in line 2109--2808. Found by clang-tidy's "readability-redundant-preprocessor" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/virfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index e8713613e3..e07f3d6b9c 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2643,7 +2643,7 @@ virDirCreateNoFork(const char *path, virReportSystemError(errno, _("stat of '%s' failed"), path); goto error; } -# ifndef WIN32 + if (((uid != (uid_t) -1 && st.st_uid != uid) || (gid != (gid_t) -1 && st.st_gid != gid)) && (chown(path, uid, gid) < 0)) { @@ -2652,7 +2652,7 @@ virDirCreateNoFork(const char *path, path, (unsigned int) uid, (unsigned int) gid); goto error; } -# endif /* !WIN32 */ + if (mode != (mode_t) -1 && chmod(path, mode) < 0) { ret = -errno; virReportSystemError(errno, -- 2.47.2