summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiko <miko@cvs.openbsd.org>2018-10-31 10:06:55 +0000
committermiko <miko@cvs.openbsd.org>2018-10-31 10:06:55 +0000
commit98e95f84c45a956def773dfabbed69e8f4fa2a77 (patch)
tree1a7f92a14e7b445a0899084334489c8b4b929da0
parent729bdbb98822194e80a198a3cc7df1921ac9fcf6 (diff)
remove a guard in mio_read(), mio_write, sio_read() & sio_write() for a
zero length request. return value of zero is preserved in this case. OK ratchov@
-rw-r--r--lib/libsndio/mio.c14
-rw-r--r--lib/libsndio/sio.c10
2 files changed, 2 insertions, 22 deletions
diff --git a/lib/libsndio/mio.c b/lib/libsndio/mio.c
index 879ff656061..ddab5a4e0c8 100644
--- a/lib/libsndio/mio.c
+++ b/lib/libsndio/mio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mio.c,v 1.21 2018/09/19 14:01:52 miko Exp $ */
+/* $OpenBSD: mio.c,v 1.22 2018/10/31 10:06:54 miko Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -128,10 +128,6 @@ mio_read(struct mio_hdl *hdl, void *buf, size_t len)
hdl->eof = 1;
return 0;
}
- if (len == 0) {
- DPRINTF("mio_read: zero length read ignored\n");
- return 0;
- }
while (todo > 0) {
n = hdl->ops->read(hdl, data, todo);
if (n == 0 && hdl->eof)
@@ -162,14 +158,6 @@ mio_write(struct mio_hdl *hdl, const void *buf, size_t len)
hdl->eof = 1;
return 0;
}
- if (len == 0) {
- DPRINTF("mio_write: zero length write ignored\n");
- return 0;
- }
- if (todo == 0) {
- DPRINTF("mio_write: zero length write ignored\n");
- return 0;
- }
while (todo > 0) {
n = hdl->ops->write(hdl, data, todo);
if (n == 0) {
diff --git a/lib/libsndio/sio.c b/lib/libsndio/sio.c
index 611acc8df9b..edc1fda711d 100644
--- a/lib/libsndio/sio.c
+++ b/lib/libsndio/sio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sio.c,v 1.22 2018/09/19 14:01:52 miko Exp $ */
+/* $OpenBSD: sio.c,v 1.23 2018/10/31 10:06:54 miko Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -294,10 +294,6 @@ sio_read(struct sio_hdl *hdl, void *buf, size_t len)
hdl->eof = 1;
return 0;
}
- if (todo == 0) {
- DPRINTF("sio_read: zero length read ignored\n");
- return 0;
- }
while (todo > 0) {
if (!sio_rdrop(hdl))
return 0;
@@ -335,10 +331,6 @@ sio_write(struct sio_hdl *hdl, const void *buf, size_t len)
hdl->eof = 1;
return 0;
}
- if (todo == 0) {
- DPRINTF("sio_write: zero length write ignored\n");
- return 0;
- }
while (todo > 0) {
if (!sio_wsil(hdl))
return 0;