[Libsysio-commit] HEAD: libsysio/src rw.c
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2004-09-29 21:18:09
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1275 Modified Files: rw.c Log Message: Cray New_SPR_730113 SN: WRITEX() SETS ERRNO EBADF INSTEAD OF EINVAL Correct the check for 0 xtvecs in writex. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- rw.c 13 Aug 2004 15:02:50 -0000 1.14 +++ rw.c 29 Sep 2004 21:17:58 -0000 1.15 @@ -1245,9 +1245,13 @@ SYSIO_INTERFACE_NAME(iwritex)(int fd, SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && xtv_count)) + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); + /* Perform a check on the iov_count and xtv_count */ + if ((iov_count == 0) || (xtv_count == 0)) + SYSIO_INTERFACE_RETURN(IOID_FAIL, -EINVAL); + ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec)); if (!ixtv) SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); |