From 3409f8d6af187d25c63a5d1f8ee8bff5f14555e2 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 1 Aug 2012 16:26:11 -0700 Subject: [PATCH] rspreload: Call real.close in fd_close The index into the preload lookup table is obtained by opening /dev/null and use the returned value. When closing the file, use the real close call and not the preload close call. This is a minor optimization, but clarifies the expected operation. Signed-off-by: Sean Hefty --- src/preload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preload.c b/src/preload.c index 52eaf1a5..a6801434 100644 --- a/src/preload.c +++ b/src/preload.c @@ -131,7 +131,7 @@ static int fd_open(void) return index; err2: - close(index); + real.close(index); err1: free(fdi); return ret; @@ -187,7 +187,7 @@ static enum fd_type fd_close(int index, int *fd) idm_clear(&idm, index); *fd = fdi->fd; type = fdi->type; - close(index); + real.close(index); free(fdi); } else { *fd = index; -- 2.41.0