diff options
author | simokawa <simokawa@FreeBSD.org> | 2003-01-28 17:00:23 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2003-01-28 17:00:23 +0000 |
commit | 10a2ca52268492e44668ca033b9b1e96e86a8657 (patch) | |
tree | a2e83ba3aac05597869965cbbc678292405b2402 /usr.sbin/fwcontrol/fwcontrol.c | |
parent | 13f4fc9ec0f9b9b0095892b27a95885abb78f347 (diff) | |
download | FreeBSD-src-10a2ca52268492e44668ca033b9b1e96e86a8657.zip FreeBSD-src-10a2ca52268492e44668ca033b9b1e96e86a8657.tar.gz |
- Search free device node to open. (fwcontrol.c)
- Exploit multiple packets read/write for DV stream. (fwdv.c)
- Add reference to libdv in the ports collection. (fwcontrol.8)
Diffstat (limited to 'usr.sbin/fwcontrol/fwcontrol.c')
-rw-r--r-- | usr.sbin/fwcontrol/fwcontrol.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/fwcontrol/fwcontrol.c b/usr.sbin/fwcontrol/fwcontrol.c index 9783a57..8ade0a1 100644 --- a/usr.sbin/fwcontrol/fwcontrol.c +++ b/usr.sbin/fwcontrol/fwcontrol.c @@ -215,7 +215,7 @@ static int get_crom(int fd, int node, void *crom_buf, int len) { struct fw_crom_buf buf; - int i, n, error; + int i, error; struct fw_devlstreq *data; data = get_dev(fd); @@ -362,11 +362,16 @@ show_topology_map(int fd) int main(int argc, char **argv) { - char devname[] = "/dev/fw1"; + char devname[256]; u_int32_t crom_buf[1024/4]; - int fd, tmp, ch, len=1024; + int fd, i, tmp, ch, len=1024; - if ((fd = open(devname, O_RDWR)) < 0) + for (i = 0; i < 4; i++) { + snprintf(devname, sizeof(devname), "/dev/fw%d", i); + if ((fd = open(devname, O_RDWR)) >= 0) + break; + } + if (fd < 0) err(1, "open"); if (argc < 2) { |