diff options
Diffstat (limited to 'lib/fuse.c')
-rw-r--r-- | lib/fuse.c | 29 |
1 files changed, 24 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; |