diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fuse.c | 29 | ||||
-rw-r--r-- | lib/mount.c | 4 |
2 files changed, 28 insertions, 5 deletions
@@ -17,6 +17,9 @@ #include <errno.h> #include <sys/param.h> +#define FUSE_VERSION_FILE_OLD "/proc/fs/fuse/version" +#define FUSE_DEV_OLD "/proc/fs/fuse/dev" + #define FUSE_MAX_PATH 4096 #define PARAM(inarg) (((char *)(inarg)) + sizeof(*inarg)) @@ -1722,12 +1725,18 @@ static int check_version(struct fuse *f) const char *version_file = FUSE_VERSION_FILE; FILE *vf = fopen(version_file, "r"); if (vf == NULL) { - version_file = "/sys/fs/fuse/version"; + version_file = FUSE_VERSION_FILE_OLD; vf = fopen(version_file, "r"); if (vf == NULL) { - fprintf(stderr, "fuse: kernel interface too old, need >= %i.%i\n", - FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION); - return -1; + struct stat tmp; + if (stat(FUSE_DEV_OLD, &tmp) != -1) { + fprintf(stderr, "fuse: kernel interface too old, need >= %i.%i\n", + FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION); + return -1; + } else { + fprintf(stderr, "fuse: warning: version of kernel interface unknown\n"); + return 0; + } } } res = fscanf(vf, "%i.%i", &f->majorver, &f->minorver); @@ -1817,7 +1826,17 @@ struct fuse *fuse_new(int fd, const char *opts, const struct fuse_operations *op if (f->id_table == NULL) goto out_free_name_table; - pthread_mutex_init(&f->lock, NULL); +#ifndef USE_UCLIBC + pthread_mutex_init(&f->lock, NULL); +#else + { + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); + pthread_mutex_init(&f->lock, &attr); + pthread_mutexattr_destroy(&attr); + } +#endif f->numworker = 0; f->numavail = 0; f->op = *op; diff --git a/lib/mount.c b/lib/mount.c index 05dcb59..a84dbee 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -91,7 +91,11 @@ int fuse_mount(const char *mountpoint, const char *opts) return -1; } +#ifndef USE_UCLIBC pid = fork(); +#else + pid = vfork(); +#endif if(pid == -1) { perror("fuse: fork() failed"); close(fds[0]); |