summaryrefslogtreecommitdiff
path: root/example-24/fusexmp_fh.c.patch
blob: c45ece0c6640617340af11a1a40547d0278f0142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- fusexmp_fh.c.orig	2005-12-02 01:47:51.000000000 +0100
+++ fusexmp_fh.c	2005-12-02 01:58:16.000000000 +0100
@@ -71,7 +71,7 @@
         memset(&st, 0, sizeof(st));
         st.st_ino = de->d_ino;
         st.st_mode = de->d_type << 12;
-        if (filler(buf, de->d_name, &st, de->d_off))
+        if (filler(buf, de->d_name, &st, telldir(dp)))
             break;
     }
 
@@ -90,7 +90,12 @@
 {
     int res;
 
-    res = mknod(path, mode, rdev);
+    /* On the Hurd we must not use mknod() to create files, but creat() */
+    if(mode & S_IFREG)
+      res = creat(path, mode & ALLPERMS);
+    else
+      res = mknod(path, mode, rdev);
+
     if(res == -1)
         return -errno;