summaryrefslogtreecommitdiffstats
path: root/lib/libfuse
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2013-11-11 14:23:01 +0000
committerstsp <stsp@openbsd.org>2013-11-11 14:23:01 +0000
commit8e11bbb8eed9cb17a2463e1279f2e3613afa8166 (patch)
treeb461fe290870e8a763e8819ce5e0ab91086f7685 /lib/libfuse
parentThere is no fusebuf(9) man page anymore. Remove references to it from comments. (diff)
downloadwireguard-openbsd-8e11bbb8eed9cb17a2463e1279f2e3613afa8166.tar.xz
wireguard-openbsd-8e11bbb8eed9cb17a2463e1279f2e3613afa8166.zip
In fuse_loop(), use ssize_t to store return values from read(2) and write(2).
ok syl@
Diffstat (limited to 'lib/libfuse')
-rw-r--r--lib/libfuse/fuse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libfuse/fuse.c b/lib/libfuse/fuse.c
index 3846d835491..cec4c25e571 100644
--- a/lib/libfuse/fuse.c
+++ b/lib/libfuse/fuse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse.c,v 1.16 2013/11/09 13:39:37 stsp Exp $ */
+/* $OpenBSD: fuse.c,v 1.17 2013/11/11 14:23:01 stsp Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -61,7 +61,7 @@ fuse_loop(struct fuse *fuse)
struct fuse_context ctx;
struct fb_ioctl_xch ioexch;
struct kevent ev;
- int error = 0;
+ ssize_t n;
int ret;
fuse->fc->kq = kqueue();
@@ -76,8 +76,8 @@ fuse_loop(struct fuse *fuse)
if (ret == -1)
DPERROR(__func__);
else if (ret > 0) {
- error = read(fuse->fc->fd, &fbuf, sizeof(fbuf));
- if (error != sizeof(fbuf)) {
+ n = read(fuse->fc->fd, &fbuf, sizeof(fbuf));
+ if (n != sizeof(fbuf)) {
fprintf(stderr, "%s: bad fusebuf read\n",
__func__);
return (-1);
@@ -113,7 +113,7 @@ fuse_loop(struct fuse *fuse)
return (ret);
}
- ret = write(fuse->fc->fd, &fbuf, sizeof(fbuf));
+ n = write(fuse->fc->fd, &fbuf, sizeof(fbuf));
if (fbuf.fb_len) {
if (fbuf.fb_dat == NULL) {
fprintf(stderr, "%s: fb_dat is Null\n",
@@ -132,7 +132,7 @@ fuse_loop(struct fuse *fuse)
}
ictx = NULL;
- if (ret != FUSEBUFSIZE) {
+ if (n != FUSEBUFSIZE) {
errno = EINVAL;
return (-1);
}