diff options
-rw-r--r-- | mandocdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -801,7 +801,7 @@ filescan(const char *file) exitcode = (int)MANDOCLEVEL_BADARG; say(file, "&lstat"); return; - } else if ((st.st_mode & (S_IFREG | S_IFLNK)) == 0) { + } else if (S_ISREG(st.st_mode) == 0 && S_ISLNK(st.st_mode) == 0) { exitcode = (int)MANDOCLEVEL_BADARG; say(file, "Not a regular file"); return; @@ -840,7 +840,7 @@ filescan(const char *file) * Note the stat(2) can still fail if the link target * doesn't exist. */ - if (st.st_mode & S_IFLNK) { + if (S_ISLNK(st.st_mode)) { if (stat(buf, &st) == -1) { exitcode = (int)MANDOCLEVEL_BADARG; say(file, "&stat"); |