[Libsysio-commit] HEAD: libsysio/src file.c
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2004-02-27 19:38:34
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21780 Modified Files: file.c Log Message: want to ref the file if a valid fd was returned, otherwise subsequent close of dup'd fd wipes out the original fd's file struct Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- file.c 6 Feb 2004 20:07:30 -0000 1.7 +++ file.c 27 Feb 2004 19:21:50 -0000 1.8 @@ -273,7 +273,7 @@ _sysio_fd_dup2(int oldfd, int newfd) return -EBADF; err = _sysio_fd_set(fil, newfd); - if (!err) + if (err >= 0) F_REF(fil); return err; } |