Skip to content

Commit 792b8e3

Browse files
committed
OpenBSD doesn't have f_type in statfs()
1 parent e1973aa commit 792b8e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/lwan-request.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,6 @@ body_data_finalizer(const struct lwan_value *buffer,
11101110
__attribute__((cold))
11111111
static const char *is_dir_good_for_tmp(const char *v)
11121112
{
1113-
struct statfs sb;
11141113
struct stat st;
11151114

11161115
if (!v)
@@ -1132,11 +1131,14 @@ static const char *is_dir_good_for_tmp(const char *v)
11321131
v);
11331132
}
11341133

1134+
#ifndef __OpenBSD__ /* OpenBSD doesn't have f_type */
1135+
struct statfs sb;
11351136
if (!statfs(v, &sb) && sb.f_type == TMPFS_MAGIC) {
11361137
lwan_status_warning("%s is a tmpfs filesystem, "
11371138
"not considering it", v);
11381139
return NULL;
11391140
}
1141+
#endif
11401142

11411143
return v;
11421144
}

0 commit comments

Comments
 (0)