aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/passthrough.c')
-rw-r--r--example/passthrough.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/example/passthrough.c b/example/passthrough.c
index da91930..6de9fc1 100644
--- a/example/passthrough.c
+++ b/example/passthrough.c
@@ -44,11 +44,17 @@
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
+#ifdef __FreeBSD__
+#include <sys/socket.h>
+#include <sys/un.h>
+#endif
#include <sys/time.h>
#ifdef HAVE_SETXATTR
#include <sys/xattr.h>
#endif
+#include "passthrough_helpers.h"
+
static void *xmp_init(struct fuse_conn_info *conn,
struct fuse_config *cfg)
{
@@ -138,16 +144,7 @@ static int xmp_mknod(const char *path, mode_t mode, dev_t rdev)
{
int res;
- /* On Linux this could just be 'mknod(path, mode, rdev)' but this
- is more portable */
- if (S_ISREG(mode)) {
- res = open(path, O_CREAT | O_EXCL | O_WRONLY, mode);
- if (res >= 0)
- res = close(res);
- } else if (S_ISFIFO(mode))
- res = mkfifo(path, mode);
- else
- res = mknod(path, mode, rdev);
+ res = mknod_wrapper(AT_FDCWD, path, NULL, mode, rdev);
if (res == -1)
return -errno;