diff --git a/common/dconf-shmdir.c b/common/dconf-shmdir.c
index d87d6d7..399db8e 100644
--- a/common/dconf-shmdir.c
+++ b/common/dconf-shmdir.c
@@ -21,13 +21,14 @@
 
 #include "dconf-shmdir.h"
 
-#ifndef __FreeBSD__
+#ifdef __FreeBSD__
+#include <sys/param.h>
+#include <sys/mount.h>
+#else
 #include <sys/statfs.h>
 #include <sys/vfs.h>
 #endif
 
-#include <sys/param.h>
-#include <sys/mount.h>
 #include <errno.h>
 
 #ifndef NFS_SUPER_MAGIC
