diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-01-04 18:20:38 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-01-04 18:20:38 +0000 |
commit | fd22cc004d17fbeaca59562ddb9c3e8faa9b45cd (patch) | |
tree | 365e8a6a3a5c84e3a10211667f3406a7226f6d09 /usr.bin | |
parent | 32bce34950d00660d3818257373b2667098b5c22 (diff) |
Fix some issues noted by Joris Vink; pedro@ OK
o g/c the changed field in struct field
o increment argv for bad fields too
o deal with AUDIO_MIXER_DEVINFO (unlikely) failures
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mixerctl/mixerctl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/mixerctl/mixerctl.c b/usr.bin/mixerctl/mixerctl.c index d7f339703c7..25b2beffe7e 100644 --- a/usr.bin/mixerctl/mixerctl.c +++ b/usr.bin/mixerctl/mixerctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mixerctl.c,v 1.16 2004/03/02 23:09:27 tedu Exp $ */ +/* $OpenBSD: mixerctl.c,v 1.17 2005/01/04 18:20:37 millert Exp $ */ /* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */ /* @@ -63,7 +63,6 @@ struct field { char *name; mixer_ctrl_t *valp; mixer_devinfo_t *infp; - char changed; } *fields, *rfields; mixer_ctrl_t *values; @@ -230,7 +229,6 @@ rdfield(struct field *p, char *q) default: errx(1, "Invalid format."); } - p->changed = 1; return (1); } @@ -297,7 +295,10 @@ main(int argc, char **argv) for(i = 0; i < ndev; i++) { infos[i].index = i; - ioctl(fd, AUDIO_MIXER_DEVINFO, &infos[i]); + if (ioctl(fd, AUDIO_MIXER_DEVINFO, &infos[i]) < 0) { + ndev--, i--; + continue; + } } for(i = 0; i < ndev; i++) { @@ -372,7 +373,6 @@ main(int argc, char **argv) } } } - argv++; } else { p = findfield(*argv); if (p == NULL) @@ -382,6 +382,7 @@ main(int argc, char **argv) fprintf(out, "\n"); } } + argv++; } } else usage(); |