diff options
| author | Joerg Wunsch <joerg@FreeBSD.org> | 2008-10-30 19:51:02 +0000 |
|---|---|---|
| committer | Joerg Wunsch <joerg@FreeBSD.org> | 2008-10-30 19:51:02 +0000 |
| commit | 7f33c7dd6fec3cfc534704ce9d77c7792977e370 (patch) | |
| tree | 431e60e87318892ead00b945105b19b8dde05cf8 /bin/chio/chio.c | |
| parent | 9fccea878acc1002025cd83b4d00aadc682e7fd4 (diff) | |
Notes
Diffstat (limited to 'bin/chio/chio.c')
| -rw-r--r-- | bin/chio/chio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/chio/chio.c b/bin/chio/chio.c index cdfcf829a0b1..aaddb689d52f 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -69,7 +69,7 @@ static const char *bits_to_string(ces_status_flags, const char *); static void find_element(char *, uint16_t *, uint16_t *); static struct changer_element_status *get_element_status - (unsigned int, unsigned int); + (unsigned int, unsigned int, int); static int do_move(const char *, int, char **); static int do_exchange(const char *, int, char **); @@ -969,7 +969,8 @@ do_return(const char *cname, int argc, char **argv) ++argv; --argc; /* Get the status */ - ces = get_element_status((unsigned int)type, (unsigned int)element); + ces = get_element_status((unsigned int)type, (unsigned int)element, + CHET_VT == type); if (NULL == ces) errx(1, "%s: null element status pointer", cname); @@ -1004,7 +1005,7 @@ usage: * should free() it when done. */ static struct changer_element_status * -get_element_status(unsigned int type, unsigned int element) +get_element_status(unsigned int type, unsigned int element, int use_voltags) { struct changer_element_status_request cesr; struct changer_element_status *ces; @@ -1020,7 +1021,8 @@ get_element_status(unsigned int type, unsigned int element) cesr.cesr_element_type = (uint16_t)type; cesr.cesr_element_base = (uint16_t)element; cesr.cesr_element_count = 1; /* Only this one element */ - cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */ + if (use_voltags) + cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */ cesr.cesr_element_status = ces; if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { |
