diff options
author | Kenneth D. Merry <ken@FreeBSD.org> | 2004-03-03 01:51:24 +0000 |
---|---|---|
committer | Kenneth D. Merry <ken@FreeBSD.org> | 2004-03-03 01:51:24 +0000 |
commit | 2a413b2918399b077995abb9078322195c275fad (patch) | |
tree | ac0008c512b35b81b718ad3733a16c980ada1b4c /sbin | |
parent | b81dae751b27b74c07eb716c9ef301eb1c8e63a6 (diff) | |
download | src-2a413b2918399b077995abb9078322195c275fad.tar.gz src-2a413b2918399b077995abb9078322195c275fad.zip |
Notes
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/camcontrol/camcontrol.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 3b4889e8c361..acf9ae1ab3e1 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -166,7 +166,9 @@ camcontrol_optret getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, const char **subopt); #ifndef MINIMALISTIC static int getdevlist(struct cam_device *device); +#endif /* MINIMALISTIC */ static int getdevtree(void); +#ifndef MINIMALISTIC static int testunitready(struct cam_device *device, int retry_count, int timeout, int quiet); static int scsistart(struct cam_device *device, int startstop, int loadeject, @@ -303,8 +305,11 @@ getdevtree(void) return(1); } - bzero(&(&ccb.ccb_h)[1], - sizeof(struct ccb_dev_match) - sizeof(struct ccb_hdr)); + bzero(&ccb, sizeof(union ccb)); + + ccb.ccb_h.path_id = CAM_XPT_PATH_ID; + ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; ccb.ccb_h.func_code = XPT_DEV_MATCH; bufsize = sizeof(struct dev_match_result) * 100; @@ -3380,6 +3385,11 @@ main(int argc, char **argv) errx(1, "numeric device specification must " "be either bus:target, or " "bus:target:lun"); + /* default to 0 if lun was not specified */ + if ((arglist & CAM_ARG_LUN) == 0) { + lun = 0; + arglist |= CAM_ARG_LUN; + } optstart++; } else { if (cam_get_device(argv[2], name, sizeof name, &unit) |