From 2d932dd26b3d5e53d2ae855a509219cfb8b6a0ed Mon Sep 17 00:00:00 2001 From: Nick Chan Date: Sat, 25 Mar 2023 13:40:45 +0800 Subject: [PATCH] fix POSIX 2002 C --- src/optparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/optparse.c b/src/optparse.c index b24f7d3..6c4faf6 100644 --- a/src/optparse.c +++ b/src/optparse.c @@ -213,7 +213,7 @@ int optparse(int argc, char* argv[]) { } else if (!(st.st_mode & S_IXUSR) && !(st.st_mode & S_IXGRP) && !(st.st_mode & S_IXOTH)) { LOG(LOG_FATAL, "%s is not executable", optarg); return -1; - } else if (!(st.st_mode & S_IFREG)) { + } else if (!S_ISREG(st.st_mode)) { LOG(LOG_FATAL, "%s is not a regular file", optarg); return -1; }