diff options
author | jkh <jkh@FreeBSD.org> | 1996-12-26 21:03:04 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-12-26 21:03:04 +0000 |
commit | 830dff98817f6084350ae4b2e2c9cc4ab487c92b (patch) | |
tree | 5cc60b929f2294132fc87a4a139e2296ddf66d00 /usr.sbin | |
parent | 3ff0051e69fee9f8dcd783db742650f7fcbd5259 (diff) | |
download | FreeBSD-src-830dff98817f6084350ae4b2e2c9cc4ab487c92b.zip FreeBSD-src-830dff98817f6084350ae4b2e2c9cc4ab487c92b.tar.gz |
Clean up some calls to close().
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/devices.c | 10 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 10 |
2 files changed, 8 insertions, 12 deletions
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index 61d0b9d..73806de 100644 --- a/usr.sbin/sade/devices.c +++ b/usr.sbin/sade/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.54 1996/12/11 09:34:55 jkh Exp $ + * $Id: devices.c,v 1.55 1996/12/14 23:08:52 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -287,7 +287,7 @@ skipif: case DEVICE_TYPE_TAPE: fd = deviceTry(device_names[i].name, try); if (fd >= 0) { - if (fd) close(fd); + close(fd); deviceRegister(device_names[i].name, device_names[i].description, strdup(try), DEVICE_TYPE_TAPE, TRUE, mediaInitTape, mediaGetTape, mediaShutdownTape, NULL); msgDebug("Found a TAPE device named %s\n", device_names[i].name); @@ -297,7 +297,7 @@ skipif: case DEVICE_TYPE_FLOPPY: fd = deviceTry(device_names[i].name, try); if (fd >= 0) { - if (fd) close(fd); + close(fd); deviceRegister(device_names[i].name, device_names[i].description, strdup(try), DEVICE_TYPE_FLOPPY, TRUE, mediaInitFloppy, mediaGetFloppy, mediaShutdownFloppy, NULL); @@ -311,9 +311,7 @@ skipif: if (fd >= 0) { char *newdesc, *cp; - if (fd) - close(fd); - + close(fd); /* Serial devices get a slip and ppp device each */ cp = device_names[i].description; newdesc = safe_malloc(strlen(cp) + 40); diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 61d0b9d..73806de 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.54 1996/12/11 09:34:55 jkh Exp $ + * $Id: devices.c,v 1.55 1996/12/14 23:08:52 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -287,7 +287,7 @@ skipif: case DEVICE_TYPE_TAPE: fd = deviceTry(device_names[i].name, try); if (fd >= 0) { - if (fd) close(fd); + close(fd); deviceRegister(device_names[i].name, device_names[i].description, strdup(try), DEVICE_TYPE_TAPE, TRUE, mediaInitTape, mediaGetTape, mediaShutdownTape, NULL); msgDebug("Found a TAPE device named %s\n", device_names[i].name); @@ -297,7 +297,7 @@ skipif: case DEVICE_TYPE_FLOPPY: fd = deviceTry(device_names[i].name, try); if (fd >= 0) { - if (fd) close(fd); + close(fd); deviceRegister(device_names[i].name, device_names[i].description, strdup(try), DEVICE_TYPE_FLOPPY, TRUE, mediaInitFloppy, mediaGetFloppy, mediaShutdownFloppy, NULL); @@ -311,9 +311,7 @@ skipif: if (fd >= 0) { char *newdesc, *cp; - if (fd) - close(fd); - + close(fd); /* Serial devices get a slip and ppp device each */ cp = device_names[i].description; newdesc = safe_malloc(strlen(cp) + 40); |