#include <sys/stat.h>
#include <stdio.h>
#if !defined(_WIN32)
+#include <strings.h>
#include <dirent.h>
#endif
#include "commands.h"
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);
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);