diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-03-17 15:56:05 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2006-03-17 15:56:05 +0000 |
commit | 8d975f6fb3f54c82f295b5e44391637a7c008345 (patch) | |
tree | b86bb953018aaf573bb88df08cd48df97bc02d75 /lib/fuse_kern_chan.c | |
parent | 6f385414b27e929bd14435ea8342cde4bae0ef8d (diff) | |
download | libfuse-8d975f6fb3f54c82f295b5e44391637a7c008345.tar.gz |
fix
Diffstat (limited to 'lib/fuse_kern_chan.c')
-rw-r--r-- | lib/fuse_kern_chan.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/fuse_kern_chan.c b/lib/fuse_kern_chan.c index fe7d252..45ff738 100644 --- a/lib/fuse_kern_chan.c +++ b/lib/fuse_kern_chan.c @@ -14,8 +14,10 @@ #include <unistd.h> #include <assert.h> -static int fuse_kern_chan_receive(struct fuse_chan *ch, char *buf, size_t size) +static int fuse_kern_chan_receive(struct fuse_chan **chp, char *buf, + size_t size) { + struct fuse_chan *ch = *chp; int err; ssize_t res; struct fuse_session *se = fuse_chan_session(ch); @@ -50,18 +52,20 @@ static int fuse_kern_chan_receive(struct fuse_chan *ch, char *buf, size_t size) static int fuse_kern_chan_send(struct fuse_chan *ch, const struct iovec iov[], size_t count) { - ssize_t res = writev(fuse_chan_fd(ch), iov, count); - int err = errno; + if (iov) { + ssize_t res = writev(fuse_chan_fd(ch), iov, count); + int err = errno; - if (res == -1) { - struct fuse_session *se = fuse_chan_session(ch); + if (res == -1) { + struct fuse_session *se = fuse_chan_session(ch); - assert(se != NULL); + assert(se != NULL); - /* ENOENT means the operation was interrupted */ - if (!fuse_session_exited(se) && err != ENOENT) - perror("fuse: writing device"); - return -err; + /* ENOENT means the operation was interrupted */ + if (!fuse_session_exited(se) && err != ENOENT) + perror("fuse: writing device"); + return -err; + } } return 0; } |