From 96747dc0154eaee558a330165b9f43365d4b0dd7 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 2 Jan 2009 08:21:21 +0000 Subject: [PATCH] Add fd = -1 after close when we detect the format so that subsequent open_dev will reopen the device. --- usr.sbin/fwcontrol/fwcontrol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/fwcontrol/fwcontrol.c b/usr.sbin/fwcontrol/fwcontrol.c index b55cf2ac9469..eabbc23b45c9 100644 --- a/usr.sbin/fwcontrol/fwcontrol.c +++ b/usr.sbin/fwcontrol/fwcontrol.c @@ -1065,6 +1065,7 @@ main(int argc, char **argv) if (recvfn == NULL) { /* guess... */ recvfn = detect_recv_fn(fd, TAG | CHANNEL); close(fd); + fd = -1; } snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board); if (open_dev(&fd, devbase) < 0)