diff options
Diffstat (limited to 'util/ipmidir.c')
-rw-r--r-- | util/ipmidir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/ipmidir.c b/util/ipmidir.c index 501f47b..2aeb6f3 100644 --- a/util/ipmidir.c +++ b/util/ipmidir.c @@ -473,8 +473,10 @@ int ipmi_close_direct(void) { int status = 0; #if defined(BSD) || defined(MACOS) || defined(HPUX) - close(iofd); - iofd = -1; + if (iofd >= 0) { + close(iofd); + iofd = -1; + } #endif /* clear lock for driverless interface */ status = clear_lock_dir(); |