From: Nickolai Zeldovich Date: Sat, 23 Jun 2001 18:13:16 +0000 (+0000) Subject: fix-fs-error-string-printing-20010623 X-Git-Tag: openafs-stable-1_1_0~88 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6d6f2c265fca3ec917f26ccc5c736aa13134dcfb;p=packages%2Fo%2Fopenafs.git fix-fs-error-string-printing-20010623 return useful error codes so correct errors can be printed --- diff --git a/src/venus/fs.c b/src/venus/fs.c index 2fdaf0750..5658da479 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -817,7 +817,7 @@ static afs_int32 GetCell(fname, cellname) blob.out = cellname; code = pioctl(fname, VIOC_FILE_CELL_NAME, &blob, 1); - return code; + return code ? errno : 0; } /* Check if a username is valid: If it contains only digits (or a @@ -1975,7 +1975,7 @@ static WhichCellCmd(as) if (errno == ENOENT) fprintf(stderr,"%s: no such cell as '%s'\n", pn, ti->data); else - Die(code, ti->data); + Die(errno, ti->data); error = 1; continue; } @@ -2796,7 +2796,7 @@ static afs_int32 SetCryptCmd(as) blob.out_size = 0; code = pioctl(0, VIOC_SETRXKCRYPT, &blob, 1); if (code) - Die(code, (char *) 0); + Die(errno, (char *) 0); return 0; } @@ -2815,7 +2815,7 @@ static afs_int32 GetCryptCmd(as) code = pioctl(0, VIOC_GETRXKCRYPT, &blob, 1); - if (code) Die(code, (char *) 0); + if (code) Die(errno, (char *) 0); else { tp = space; bcopy(tp, &flag, sizeof(afs_int32));