]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
fs: display cell not available on ESRCH
authorMichael Meffie <mmeffie@sinenomine.net>
Fri, 7 Feb 2014 14:55:31 +0000 (06:55 -0800)
committerD Brashear <shadow@your-file-system.com>
Tue, 25 Mar 2014 16:53:12 +0000 (09:53 -0700)
The cache manager pioctls abuse ESRCH to represent errors due to
unavailable cell information.  Give a more sensible error message to
the user when a pioctl returns an ESRCH error, instead of "no such
process", which is the conventional meaning of ESRCH.

The new error message is consistent with the Windows implementation
of fs.

For example, on a host with a misconfigured ThisCell and/or CellServDB.

    $ fs wscell
    fs: No such process

becomes:

    $ fs wscell
    fs: Cell name not recognized.

Change-Id: Ibdcb0957118205b9540cae07b3cafa65c51ff497
Reviewed-on: http://gerrit.openafs.org/10824
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
src/venus/fs.c

index cd2f82735f70e4e9c158fdb57d748594883b89f4..43294340c1d23b776cf061d3e7fc6556fc9f79a2 100644 (file)
@@ -4010,6 +4010,9 @@ Die(int errnum, char *filename)
                    "%s: You do not have the required rights to do this operation\n",
                    pn);
        break;
+    case ESRCH: /* hack: pioctls stole ESRCH for cell name not available errors. */
+       fprintf(stderr, "%s: Cell name not recognized.\n", pn);
+       break;
     default:
        if (filename)
            fprintf(stderr, "%s:'%s'", pn, filename);