From: Petr S. <pe...@us...> - 2000-12-11 20:48:27
|
Update of /cvsroot/cscope/cscope/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv15540/src Modified Files: mypopen.c Log Message: Bruce Frost's suggestion that mypopen has a safety issue with fcntl failing with CLOSE_ON_EXEC Index: mypopen.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/mypopen.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mypopen.c 2000/05/03 22:02:10 1.3 --- mypopen.c 2000/12/11 20:48:18 1.4 *************** *** 63,67 **** return(fd); ! else return(-1); } --- 63,78 ---- return(fd); ! else ! { ! // Ensure that if the fcntl fails and fd is valid, then ! // the file is closed properly. In general this should ! // not happen. ! if (fd != -1) ! { ! close (fd); ! } ! ! return(-1); ! } } |