From f6ba1b9e966565e574de351de34501e10945c9fc Mon Sep 17 00:00:00 2001 From: liangzhen Date: Thu, 11 Sep 2008 06:55:46 +0000 Subject: [PATCH] Branch HEAD Close file handle for applymask i=isaac --- lnet/utils/debug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lnet/utils/debug.c b/lnet/utils/debug.c index 8dfc0ff..2cbfcd1 100644 --- a/lnet/utils/debug.c +++ b/lnet/utils/debug.c @@ -244,10 +244,11 @@ static int applymask(char* procpath, int value) if (rc != 0) { fprintf(stderr, "Write to %s failed: %s\n", procpath, strerror(errno)); - return rc; } + dbg_close_ctlhandle(fd); - return 0; + + return rc; } static void applymask_all(unsigned int subs_mask, unsigned int debug_mask) @@ -479,7 +480,7 @@ int jt_dbg_debug_kernel(int argc, char **argv) if (rc != 0) { fprintf(stderr, "write(%s) failed: %s\n", filename, strerror(errno)); - close(fd); + dbg_close_ctlhandle(fd); return 1; } dbg_close_ctlhandle(fd); -- 1.8.3.1