DIR *d;
gint cur_req = 0;
struct dirent *ent;
+#if defined(__sun)
+ struct stat sb;
+#endif
FILE *in;
char filebuf[PATH_MAX];
if (d != NULL) {
while ((ent = readdir (d))) {
+ rspamd_snprintf (filebuf, sizeof (filebuf), "%s%c%s",
+ name, G_DIR_SEPARATOR, ent->d_name);
+#if defined(__sun)
+ if (stat (filebuf, &sb)) continue;
+ if (S_ISREG (sb.st_mode)) {
+#else
if (ent->d_type == DT_REG || ent->d_type == DT_UNKNOWN) {
- rspamd_snprintf (filebuf, sizeof (filebuf), "%s%c%s",
- name, G_DIR_SEPARATOR, ent->d_name);
+#endif
if (access (filebuf, R_OK) != -1) {
in = fopen (filebuf, "r");
if (in == NULL) {