Skip to content
Snippets Groups Projects
Commit d95739d5 authored by Jean-Damien Durand's avatar Jean-Damien Durand Committed by Steven Murray
Browse files

Accept nbytes == 0 in netread/netwrite/netread_timeout/netwrite_timeout

parent 4e7177cb
No related branches found
No related tags found
No related merge requests found
......@@ -171,7 +171,7 @@ int nbytes;
{
register int n, nb;
if (nbytes <= 0) {
if (nbytes < 0) {
serrno = EINVAL;
return(-1);
}
......@@ -243,7 +243,7 @@ int nbytes;
{
register int n, nb;
if (nbytes <= 0) {
if (nbytes < 0) {
serrno = EINVAL;
return(-1);
}
......
......@@ -4,7 +4,7 @@
*/
#ifndef lint
static char sccsid[] = "@(#)$RCSfile: socket_timeout.c,v $ $Revision: 1.17 $ $Date: 2001/10/23 06:24:45 $ CERN IT-PDP/DM Jean-Damien Durand";
static char sccsid[] = "@(#)$RCSfile: socket_timeout.c,v $ $Revision: 1.18 $ $Date: 2002/09/04 07:35:10 $ CERN IT-PDP/DM Jean-Damien Durand";
#endif /* not lint */
#include <stdlib.h>
......@@ -163,8 +163,8 @@ ssize_t DLL_DECL netread_timeout(fd, vptr, n, timeout)
time_t time_start;
int time_elapsed;
/* If n <= 0 (on some systems size_t can be lower than zero) it is an app. error */
if (n <= 0) {
/* If n < 0 it is an app. error */
if (n < 0) {
serrno = EINVAL;
return(-1);
}
......@@ -265,8 +265,8 @@ ssize_t DLL_DECL netwrite_timeout(fd, vptr, n, timeout)
time_t time_start;
int time_elapsed;
/* If n <= 0 (on some systems size_t can be lower than zero) it is an app. error */
if (n <= 0) {
/* If n < 0 it is an app. error */
if (n < 0) {
serrno = EINVAL;
return(-1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment