diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-01-04 12:45:54 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2005-01-04 12:45:54 +0000 |
commit | 0f62d7265ebab7807978ae8a206213d968bea9e4 (patch) | |
tree | 5039e673540eb681b78849f665beb5efed2bcc54 /lib/helper.c | |
parent | 0fcfa039c1dfb7cf9d9da132972334e33f320dd1 (diff) | |
download | libfuse-0f62d7265ebab7807978ae8a206213d968bea9e4.tar.gz |
interrupted request improvements
Diffstat (limited to 'lib/helper.c')
-rw-r--r-- | lib/helper.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/helper.c b/lib/helper.c index c14248d..25a60aa 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -7,6 +7,7 @@ */ #include "fuse_i.h" +#include "fuse_compat.h" #include <stdio.h> #include <stdlib.h> @@ -90,6 +91,19 @@ static int set_signal_handlers() return 0; } +static int opt_member(const char *opts, const char *opt) +{ + const char *e, *s = opts; + int optlen = strlen(opt); + for (s = opts; s; s = e + 1) { + if(!(e = strchr(s, ','))) + break; + if (e - s == optlen && strncmp(s, opt, optlen) == 0) + return 1; + } + return (s && strcmp(s, opt) == 0); +} + static int add_option_to(const char *opt, char **optp) { unsigned len = strlen(opt); @@ -187,7 +201,6 @@ static int fuse_parse_cmdline(int argc, const char *argv[], char **kernel_opts, res = add_options(lib_opts, kernel_opts, "debug"); if (res == -1) goto err; - *background = 0; break; case 'r': @@ -251,7 +264,6 @@ static int fuse_parse_cmdline(int argc, const char *argv[], char **kernel_opts, free(*mountpoint); return -1; } - static struct fuse *fuse_setup_common(int argc, char *argv[], const struct fuse_operations *op, @@ -286,7 +298,7 @@ static struct fuse *fuse_setup_common(int argc, char *argv[], if (fuse == NULL) goto err_unmount; - if (background) { + if (background && !opt_member(lib_opts, "debug")) { res = daemon(0, 0); if (res == -1) { perror("fuse: failed to daemonize program\n"); |