mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-28 16:43:09 +00:00
Clean up some calls to close().
This commit is contained in:
parent
65fb557e51
commit
9f2e984973
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=20927
@ -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 @@ deviceGetAll(void)
|
||||
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 @@ deviceGetAll(void)
|
||||
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 @@ deviceGetAll(void)
|
||||
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);
|
||||
|
@ -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 @@ deviceGetAll(void)
|
||||
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 @@ deviceGetAll(void)
|
||||
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 @@ deviceGetAll(void)
|
||||
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);
|
||||
|
@ -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 @@ deviceGetAll(void)
|
||||
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 @@ deviceGetAll(void)
|
||||
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 @@ deviceGetAll(void)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user