From: Jeffrey Altman Date: Fri, 4 Jan 2008 07:53:55 +0000 (+0000) Subject: DEVEL15-windows-fs-path-avail-20080103 X-Git-Tag: openafs-devel-1_5_30~16 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2e407ae9be478b42f555020272d0ce8eb2baa047;p=packages%2Fo%2Fopenafs.git DEVEL15-windows-fs-path-avail-20080103 LICENSE MIT fix the reporting of volume status as a result of the VIOC_PATH_AVAIL pioctl call. Switch on errno instead of the pioctl return value. (cherry picked from commit 23318f425ca8ccdc9b67bfc1be0a28c0f724f52a) --- diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index 9ca8b7dac..78e6722c3 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -1489,7 +1489,6 @@ ExamineCmd(struct cmd_syndesc *as, void *arock) struct cmd_item *ti; struct VolumeStatus *status; char *name, *offmsg, *motd; - long online_state; int error = 0; SetDotDefault(&as->parms[0].items); @@ -1540,22 +1539,25 @@ ExamineCmd(struct cmd_syndesc *as, void *arock) } else { Die(errno, ti->data); } - online_state = pioctl(ti->data, VIOC_PATH_AVAILABILITY, &blob, 1); - switch (online_state) { + + errno = 0; + code = pioctl(ti->data, VIOC_PATH_AVAILABILITY, &blob, 1); + switch (errno) { case 0: printf("Volume is online\n"); break; - case CM_ERROR_ALLOFFLINE: - printf("Volume offline\n"); + case ENXIO: + printf("Volume is offline\n"); break; - case CM_ERROR_ALLDOWN: + case ENOSYS: printf("All Volume servers are down\n"); break; - case CM_ERROR_ALLBUSY: + case EBUSY: printf("All volume servers are busy\n"); break; default: - Die(online_state, ti->data); + printf("Unknown volume state\n"); + Die(errno, ti->data); } printf("\n"); }