aboutsummaryrefslogtreecommitdiffstats
path: root/package/fuse/patches
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-11-22 03:15:32 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-11-22 03:15:32 +0000
commit7406f1dde0e55c5c5ad61ae37c0e7b16a4c4aa22 (patch)
treee691fd9cb210ca42ac03ab6c350a5ee38fa476cc /package/fuse/patches
parent7a9485b1c3b6f523755d52f408d1a6209defd468 (diff)
downloadmaster-187ad058-7406f1dde0e55c5c5ad61ae37c0e7b16a4c4aa22.tar.gz
master-187ad058-7406f1dde0e55c5c5ad61ae37c0e7b16a4c4aa22.tar.bz2
master-187ad058-7406f1dde0e55c5c5ad61ae37c0e7b16a4c4aa22.zip
package/fuse: add workaround for uClibc 0.9.29 issues, fixes owfs and possibly others
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13312 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/fuse/patches')
-rw-r--r--package/fuse/patches/300-workaround-uclibc-pthread-breakage.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/package/fuse/patches/300-workaround-uclibc-pthread-breakage.patch b/package/fuse/patches/300-workaround-uclibc-pthread-breakage.patch
new file mode 100644
index 0000000000..cef5ce2db8
--- /dev/null
+++ b/package/fuse/patches/300-workaround-uclibc-pthread-breakage.patch
@@ -0,0 +1,46 @@
+--- fuse-2.7.3.orig/lib/helper.c 2008-11-22 03:25:11.000000000 +0100
++++ fuse-2.7.3/lib/helper.c 2008-11-22 04:06:35.000000000 +0100
+@@ -178,13 +178,41 @@
+ int fuse_daemonize(int foreground)
+ {
+ int res;
++ int fd;
+
+ if (!foreground) {
+- res = daemon(0, 0);
++ /* uClibc daemon() has problems with pthread and friends */
++ /* workaround from http://www.mail-archive.com/uclibc@uclibc.org/msg01073.html */
++ /* res = daemon(0, 0); */
++ switch (res = fork()) {
++ case -1:
++ return(-1);
++ case 0:
++ break;
++ default:
++ _exit(0);
++ }
++
+ if (res == -1) {
+- perror("fuse: failed to daemonize program\n");
++ perror("fuse: failed to fork()\n");
+ return -1;
+ }
++
++ res=setsid();
++
++ if (res == -1) {
++ perror("fuse: failed to setsid()\n");
++ }
++
++ chdir("/");
++
++ if (fd = open("/dev/null", O_RDWR, 0) != -1) {
++ dup2(fd, STDIN_FILENO);
++ dup2(fd, STDOUT_FILENO);
++ dup2(fd, STDERR_FILENO);
++ if (fd > 2)
++ close(fd);
++ }
+ }
+ return 0;
+ }