]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util: do not assign return value if it is not used (#10552)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 29 Oct 2018 01:41:35 +0000 (10:41 +0900)
committerVito Caputo <vcaputo@pengaru.com>
Mon, 29 Oct 2018 01:41:35 +0000 (18:41 -0700)
src/basic/stat-util.c

index 762777e94fbbf13609df9ef36e64b4114b829daa..4e8651f4289115247b97b6d592a72333a82cf5e1 100644 (file)
@@ -47,10 +47,8 @@ int is_dir(const char* path, bool follow) {
 
 int is_dir_fd(int fd) {
         struct stat st;
-        int r;
 
-        r = fstat(fd, &st);
-        if (r < 0)
+        if (fstat(fd, &st) < 0)
                 return -errno;
 
         return !!S_ISDIR(st.st_mode);