info: Use S_ISREG() instead of S_IFREG for readability
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Dec 2020 06:39:46 +0000 (07:39 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jan 2021 06:08:03 +0000 (07:08 +0100)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/info.c

index cd9d4a008bb8d1af4f5a125220722037bb886e95..961ad606b4c93c330d5783f15bd1effd644ca36e 100644 (file)
@@ -145,7 +145,7 @@ info(void)
        fclose(fp);
        return RET_FAIL;
     }
-    if ((statb.st_mode & S_IFREG) == 0) {
+    if (!S_ISREG(statb.st_mode)) {
        pr("Error reading info file for %s\n", name);
        logerror("The info file \"%s\" is not regular file\n", filename);
        fclose(fp);
@@ -220,7 +220,7 @@ apro(void)
                fclose(fp);
                continue;
            }
-           if ((statb.st_mode & S_IFREG) == 0) {
+           if (!S_ISREG(statb.st_mode)) {
                logerror("The info file \"%s\" is not regular file\n",
                         filename);
                fclose(fp);