diff options
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r-- | lib/fuse_lowlevel.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index a505552..ef1cda5 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -17,6 +17,7 @@ #include "fuse_opt.h" #include "fuse_misc.h" #include "mount_util.h" +#include "util.h" #include <stdio.h> #include <stdlib.h> @@ -665,9 +666,9 @@ static int read_back(int fd, char *buf, size_t len) static int grow_pipe_to_max(int pipefd) { - int max; int res; - int maxfd; + long max; + long maxfd; char buf[32]; maxfd = open("/proc/sys/fs/pipe-max-size", O_RDONLY); @@ -685,7 +686,9 @@ static int grow_pipe_to_max(int pipefd) close(maxfd); buf[res] = '\0'; - max = atoi(buf); + res = libfuse_strtol(buf, &max); + if (res) + return res; res = fcntl(pipefd, F_SETPIPE_SZ, max); if (res < 0) return -errno; @@ -2907,8 +2910,9 @@ static void fuse_ll_pipe_destructor(void *data) static unsigned int get_max_pages(void) { char buf[32]; - int res; + long res; int fd; + int err; fd = open("/proc/sys/fs/fuse/max_pages_limit", O_RDONLY); if (fd < 0) @@ -2923,8 +2927,8 @@ static unsigned int get_max_pages(void) buf[res] = '\0'; - res = strtol(buf, NULL, 10); - return res < 0 ? FUSE_DEFAULT_MAX_PAGES_LIMIT : res; + err = libfuse_strtol(buf, &res); + return err ? FUSE_DEFAULT_MAX_PAGES_LIMIT : res; } int fuse_session_receive_buf(struct fuse_session *se, struct fuse_buf *buf) |