better exit handling
diff --git a/lib/fuse.c b/lib/fuse.c
index c8bc3e4..ab10df5 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -305,7 +305,7 @@
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 @@
if(res == -1) {
/* ENOENT means the operation was interrupted */
if(errno != ENOENT)
- perror("writing fuse device");
+ perror("fuse: writing device");
}
}
@@ -342,7 +342,7 @@
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 @@
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;
}