From: Peter C. <pc...@us...> - 2010-02-10 01:36:05
|
Update of /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22962/src/tests/nfs_latency/libnfs Modified Files: portmap.c nfs.h nfs.c mount.c Log Message: Get rid of some fd leaks. Index: portmap.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/portmap.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** portmap.c 9 Feb 2010 01:04:23 -0000 1.2 --- portmap.c 10 Feb 2010 01:35:57 -0000 1.3 *************** *** 87,88 **** --- 87,94 ---- return 0; } + + void + map_cleanup(void) + { + close(map_fd); + } Index: nfs.h =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/nfs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** nfs.h 21 Jun 2005 02:57:38 -0000 1.1 --- nfs.h 10 Feb 2010 01:35:57 -0000 1.2 *************** *** 19,22 **** --- 19,26 ---- int nfs_init(struct sockaddr_in * name); + /* And to clean up again */ + void map_cleanup(void); + void mnt_cleanup(void); + void nfs_cleanup(void); /* mount functions */ Index: mount.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/mount.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mount.c 9 Feb 2010 02:52:50 -0000 1.4 --- mount.c 10 Feb 2010 01:35:57 -0000 1.5 *************** *** 130,131 **** --- 130,137 ---- return 0; } + + void + mnt_cleanup(void) + { + close(mount_fd); + } Index: nfs.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/nfs.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nfs.c 9 Feb 2010 00:24:20 -0000 1.3 --- nfs.c 10 Feb 2010 01:35:57 -0000 1.4 *************** *** 536,537 **** --- 536,543 ---- return ERR_FAILURE; } + + void + nfs_cleanup(void) + { + close(nfs_fd); + } |