At 09:43 AM 4/18/00 -0400, Charles Bailey wrote:
> > For some reason a return of RMS$_DNF is not considered to be in the ENOENT
> > family after calling sys$check_access in cando_by_name(). I'm pretty sure
>
>Sure looks like a goof on my part. I've fixed it here, but didn't get it
>sorted out in time for 5.6.0. sorry.
No problem. I didn't really want it to go in until you'd had a chance to
look at it anyway.
If I can impose on you a bit further, I've done a quick review of how
RMS$_DIR (error in directory name) and RMS$_DNF (directory not found) are
used throughout vms.c and it looks like there may be a few other places that
need tweaking. In some cases the two codes are used pretty much
synonymously, which may not be a real problem except when RMS$_DIR is used
but RMS$_DNF is meant. The suggested patch below tries to distinguish them
a bit more consistently.
None of these cases is likely to be as much of a problem as the one in
cando_by_name() discussed yesterday, because there the nonexistence of a
filesystem object might be exactly what the caller wanted to know, whereas
most if not all of these are trying to do an operation that will be fatal if
the thing they want to operate on isn't there. So, if this is an
improvement it just makes the signalling a bit more specific and traps for
some things that were otherwise left to the default condition handler.
The patch is to 5.6.0 plus Charles Lane's patches plus my patch of
yesterday. The kit still passes all tests successfully after applying this
and rebuilding.
(Note: the second hunk fixes an unrelated and apparently harmless typo).
--- vms/vms.c;-1 Mon Apr 17 17:23:10 2000
+++ vms/vms.c Tue Apr 18 13:04:12 2000
@@ -835,9 +835,10 @@
switch (aclsts) {
case RMS$_FNF:
case RMS$_DNF:
- case RMS$_DIR:
case SS$_NOSUCHOBJECT:
set_errno(ENOENT); break;
+ case RMS$_DIR:
+ set_errno(ENOTDIR); break;
case RMS$_DEV:
set_errno(ENODEV); break;
case RMS$_SYN:
@@ -2263,7 +2264,7 @@
if (!(retsts & 1)) {
mynam.nam$b_nop |= NAM$M_SYNCHK;
if (retsts == RMS$_DNF || retsts == RMS$_DIR ||
- retsts == RMS$_DEV || retsts == RMS$_DEV) {
+ retsts == RMS$_DEV) {
retsts = sys$parse(&myfab,0,0);
if (retsts & 1) goto expanded;
}
@@ -3611,8 +3612,9 @@
{
case RMS$_FNF:
case RMS$_DNF:
- case RMS$_DIR:
set_errno(ENOENT); break;
+ case RMS$_DIR:
+ set_errno(ENOTDIR); break;
case RMS$_DEV:
set_errno(ENODEV); break;
case RMS$_FNM:
@@ -4186,6 +4188,8 @@
case RMS$_DEV:
set_errno(ENODEV); break;
case RMS$_DIR:
+ set_errno(ENOTDIR); break;
+ case RMS$_DNF:
case RMS$_FNF:
set_errno(ENOENT); break;
default:
@@ -5808,8 +5812,10 @@
set_vaxc_errno(sts);
switch (sts) {
case RMS$_FNF:
- case RMS$_DIR:
+ case RMS$_DNF:
set_errno(ENOENT); break;
+ case RMS$_DIR:
+ set_errno(ENOTDIR); break;
case RMS$_DEV:
set_errno(ENODEV); break;
case RMS$_SYN:
@@ -5851,8 +5857,10 @@
if (!((sts = sys$create(&fab_out)) & 1)) {
set_vaxc_errno(sts);
switch (sts) {
- case RMS$_DIR:
+ case RMS$_DNF:
set_errno(ENOENT); break;
+ case RMS$_DIR:
+ set_errno(ENOTDIR); break;
case RMS$_DEV:
set_errno(ENODEV); break;
case RMS$_SYN:
[End of Patch.]
_______________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]