From: Nikolaus Rath Date: Sun, 2 Oct 2016 16:32:02 +0000 (-0700) Subject: Inlined fuse_session_new() X-Git-Tag: fuse-3.0.0pre0~22 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=63fcf7a1434e6210a010010242fab0a17e75afee;p=qemu-gpiodev%2Flibfuse.git Inlined fuse_session_new() This function is only used in one place. --- diff --git a/lib/fuse_i.h b/lib/fuse_i.h index 62af9f2..6738197 100644 --- a/lib/fuse_i.h +++ b/lib/fuse_i.h @@ -116,13 +116,6 @@ struct fuse_module { int fuse_chan_clearfd(struct fuse_chan *ch); void fuse_chan_close(struct fuse_chan *ch); -/** - * Create a new session - * - * @return new session object, or NULL on failure - */ -struct fuse_session *fuse_session_new(void); - /** * Create a new channel * diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 31714dd..b425856 100755 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2907,12 +2907,13 @@ struct fuse_session *fuse_lowlevel_new(struct fuse_args *args, f->owner = getuid(); f->userdata = userdata; - se = fuse_session_new(); - if (!se) + se = (struct fuse_session *) malloc(sizeof(*se)); + if (se == NULL) { + fprintf(stderr, "fuse: failed to allocate session\n"); goto out_key_destroy; - + } + memset(se, 0, sizeof(*se)); se->f = f; - return se; out_key_destroy: diff --git a/lib/fuse_session.c b/lib/fuse_session.c index 6b54e43..cdf20f7 100644 --- a/lib/fuse_session.c +++ b/lib/fuse_session.c @@ -17,18 +17,6 @@ #include -struct fuse_session *fuse_session_new(void) -{ - struct fuse_session *se = (struct fuse_session *) malloc(sizeof(*se)); - if (se == NULL) { - fprintf(stderr, "fuse: failed to allocate session\n"); - return NULL; - } - memset(se, 0, sizeof(*se)); - - return se; -} - void fuse_session_add_chan(struct fuse_session *se, struct fuse_chan *ch) { assert(se->ch == NULL);