summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Christian de Rivaz <jc@eclis.ch>2011-12-22 15:43:48 +0100
committerAlexander Larsson <alexl@redhat.com>2012-01-10 11:25:17 +0100
commit9e2363b85534c2b3043f9ba1e78824b29ecc9957 (patch)
tree89692e5ccfd0588452b8a0eb8901d943156b0eb7
parent5b46daeae964754f4938bebc8d91aebede3250c6 (diff)
downloadgvfs-9e2363b85534c2b3043f9ba1e78824b29ecc9957.tar.gz
The -f (foreground) option prevent libfuse to call daemon(). First, this is not required as g_spawn_async() already detach the process. Secondly, calling daemon() and then pthread_create() produce an undefined result accoring to Opengroup. On system with the uClibc library this will badly hang the process.
Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch>
-rw-r--r--daemon/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/daemon/main.c b/daemon/main.c
index 2b2d5496..b07fa665 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -104,16 +104,23 @@ main (int argc, char *argv[])
if (!no_fuse)
{
char *fuse_path;
- char *argv2[3];
+ char *argv2[4];
fuse_path = g_build_filename (g_get_home_dir (), ".gvfs", NULL);
if (!g_file_test (fuse_path, G_FILE_TEST_EXISTS))
g_mkdir (fuse_path, 0700);
+ /* The -f (foreground) option prevent libfuse to call daemon(). */
+ /* First, this is not required as g_spawn_async() already */
+ /* detach the process. Secondly, calling daemon() and then */
+ /* pthread_create() produce an undefined result accoring to */
+ /* Opengroup. On system with the uClibc library this will badly */
+ /* hang the process. */
argv2[0] = LIBEXEC_DIR "/gvfs-fuse-daemon";
- argv2[1] = fuse_path;
- argv2[2] = NULL;
+ argv2[1] = "-f";
+ argv2[2] = fuse_path;
+ argv2[3] = NULL;
g_spawn_async (NULL,
argv2,