diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2001-11-21 12:21:19 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2001-11-21 12:21:19 +0000 |
commit | 96249989efe40367841a579c41ec5025c715afb5 (patch) | |
tree | 3843dfca5d2795eada5c1123a36369c88fdf801c /lib/fuse.c | |
parent | cc8c975f7757ce89d15aad31df6c8b7086169653 (diff) | |
download | libfuse-96249989efe40367841a579c41ec5025c715afb5.tar.gz |
better exit handling
Diffstat (limited to 'lib/fuse.c')
-rw-r--r-- | lib/fuse.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -305,7 +305,7 @@ static int fill_dir(struct fuse_dirhandle *dh, char *name, int type) reclen = FUSE_DIRENT_SIZE(&dirent); res = fwrite(&dirent, reclen, 1, dh->fp); if(res == 0) { - perror("writing directory file"); + perror("fuse: writing directory file"); return -EIO; } return 0; @@ -330,7 +330,7 @@ static void send_reply_raw(struct fuse *f, char *outbuf, size_t outsize) if(res == -1) { /* ENOENT means the operation was interrupted */ if(errno != ENOENT) - perror("writing fuse device"); + perror("fuse: writing device"); } } @@ -342,7 +342,7 @@ static void send_reply(struct fuse *f, struct fuse_in_header *in, int error, struct fuse_out_header *out; if(error > 0) { - fprintf(stderr, "positive error code: %i\n", error); + fprintf(stderr, "fuse: positive error code: %i\n", error); error = -ERANGE; } @@ -861,8 +861,11 @@ struct fuse_cmd *__fuse_read_cmd(struct fuse *f) res = read(f->fd, cmd->buf, FUSE_MAX_IN); if(res == -1) { - perror("reading fuse device"); - /* BAD... This will happen again */ + /* ENODEV means we got unmounted, so we silenty return failure */ + if(errno != ENODEV) { + perror("fuse: reading device"); + /* BAD... This will happen again */ + } free_cmd(cmd); return NULL; } |