svn commit: r228186 - user/sbruno/1394dev/fwcontrol

Sean Bruno sbruno at FreeBSD.org
Thu Dec 1 19:57:14 UTC 2011


Author: sbruno
Date: Thu Dec  1 19:57:13 2011
New Revision: 228186
URL: http://svn.freebsd.org/changeset/base/228186

Log:
  Open the device before calling detect_recv_fn()

Modified:
  user/sbruno/1394dev/fwcontrol/fwcontrol.c

Modified: user/sbruno/1394dev/fwcontrol/fwcontrol.c
==============================================================================
--- user/sbruno/1394dev/fwcontrol/fwcontrol.c	Thu Dec  1 18:46:28 2011	(r228185)
+++ user/sbruno/1394dev/fwcontrol/fwcontrol.c	Thu Dec  1 19:57:13 2011	(r228186)
@@ -1063,9 +1063,15 @@ main(int argc, char **argv)
 #define CHANNEL	63
 	if (recv_data != NULL){
 		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) {
+				err(EX_IOERR, "%s: Error opening firewire controller #%d %s in recv_data detect\n",
+					__func__, current_board, devbase);
+			} else {
+				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)


More information about the svn-src-user mailing list