* lib/lchmod.c (lchmod): Redo #if nesting so that Coverity does
not complain about unreachable code at the ‘struct stat st;’
declaration.
+2020-02-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ lchmod: pacify Coverity CID 1491216
+ * lib/lchmod.c (lchmod): Redo #if nesting so that Coverity does
+ not complain about unreachable code at the ‘struct stat st;’
+ declaration.
+
2020-02-10 Bruno Haible <bruno@clisp.org>
copysignf: Fix link error on HP-UX with cc.
{
#if HAVE_FCHMODAT
return fchmodat (AT_FDCWD, file, mode, AT_SYMLINK_NOFOLLOW);
-#elif defined O_PATH && defined AT_FDCWD
+#else
+# if defined O_PATH && defined AT_FDCWD
int fd = openat (AT_FDCWD, file, O_PATH | O_NOFOLLOW | O_CLOEXEC);
if (fd < 0)
return fd;
return chmod_result;
}
/* /proc is not mounted; fall back on racy implementation. */
-#endif
+# endif
-#if HAVE_LSTAT
+# if HAVE_LSTAT
struct stat st;
int lstat_result = lstat (file, &st);
if (lstat_result != 0)
errno = EOPNOTSUPP;
return -1;
}
-#endif
+# endif
return chmod (file, mode);
+#endif
}