Skip to content

Commit

Permalink
OpenBSD doesn't have f_type in statfs()
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed Jun 20, 2024
1 parent e1973aa commit 792b8e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/lwan-request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,6 @@ body_data_finalizer(const struct lwan_value *buffer,
__attribute__((cold))
static const char *is_dir_good_for_tmp(const char *v)
{
struct statfs sb;
struct stat st;

if (!v)
Expand All @@ -1132,11 +1131,14 @@ static const char *is_dir_good_for_tmp(const char *v)
v);
}

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

return v;
}
Expand Down

0 comments on commit 792b8e3

Please sign in to comment.