[package] base-files: fix test experession for sysupgrade
[openwrt.git] / package / fuse / patches / 300-workaround-uclibc-pthread-breakage.patch
1 --- fuse-2.7.3.orig/lib/helper.c 2008-11-22 03:25:11.000000000 +0100
2 +++ fuse-2.7.3/lib/helper.c 2008-11-22 04:06:35.000000000 +0100
3 @@ -178,13 +178,41 @@
4 int fuse_daemonize(int foreground)
5 {
6 int res;
7 + int fd;
8
9 if (!foreground) {
10 - res = daemon(0, 0);
11 + /* uClibc daemon() has problems with pthread and friends */
12 + /* workaround from http://www.mail-archive.com/uclibc@uclibc.org/msg01073.html */
13 + /* res = daemon(0, 0); */
14 + switch (res = fork()) {
15 + case -1:
16 + return(-1);
17 + case 0:
18 + break;
19 + default:
20 + _exit(0);
21 + }
22 +
23 if (res == -1) {
24 - perror("fuse: failed to daemonize program\n");
25 + perror("fuse: failed to fork()\n");
26 return -1;
27 }
28 +
29 + res=setsid();
30 +
31 + if (res == -1) {
32 + perror("fuse: failed to setsid()\n");
33 + }
34 +
35 + chdir("/");
36 +
37 + if (fd = open("/dev/null", O_RDWR, 0) != -1) {
38 + dup2(fd, STDIN_FILENO);
39 + dup2(fd, STDOUT_FILENO);
40 + dup2(fd, STDERR_FILENO);
41 + if (fd > 2)
42 + close(fd);
43 + }
44 }
45 return 0;
46 }
This page took 0.039364 seconds and 5 git commands to generate.