diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:32:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:32:54 +0000 |
commit | 86ffccf24f66032a89d70a32b3609584c0db7345 (patch) | |
tree | 2ae97fac6ea5be57cc953baf8612e8f683da0172 /lib/libfuse | |
parent | ce9fea47562d4f179d45680d6aec00ede2877141 (diff) |
When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
Diffstat (limited to 'lib/libfuse')
-rw-r--r-- | lib/libfuse/fuse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libfuse/fuse.c b/lib/libfuse/fuse.c index bc83a2812ae..2b8c0ebdfc6 100644 --- a/lib/libfuse/fuse.c +++ b/lib/libfuse/fuse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse.c,v 1.50 2018/11/16 02:16:17 tedu Exp $ */ +/* $OpenBSD: fuse.c,v 1.51 2019/06/28 13:32:42 deraadt Exp $ */ /* * Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -121,7 +121,7 @@ ifuse_try_unmount(struct fuse *f) /* unmount in another thread so fuse_loop() doesn't deadlock */ child = fork(); - if (child < 0) { + if (child == -1) { DPERROR(__func__); return; } @@ -218,7 +218,7 @@ fuse_loop(struct fuse *fuse) ioexch.fbxch_data = fbuf.fb_dat; if (ioctl(fuse->fc->fd, FIOCGETFBDAT, - &ioexch)) { + &ioexch) == -1) { free(fbuf.fb_dat); return (-1); } @@ -249,7 +249,7 @@ fuse_loop(struct fuse *fuse) ioexch.fbxch_len = fbuf.fb_len; ioexch.fbxch_data = fbuf.fb_dat; - if (ioctl(fuse->fc->fd, FIOCSETFBDAT, &ioexch)) { + if (ioctl(fuse->fc->fd, FIOCSETFBDAT, &ioexch) == -1) { free(fbuf.fb_dat); return (-1); } |