From 86ffccf24f66032a89d70a32b3609584c0db7345 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 28 Jun 2019 13:32:54 +0000 Subject: 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. --- lib/libfuse/fuse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libfuse') 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 * @@ -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); } -- cgit v1.2.3