[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] bug in unlink/MiNTLib?



Guido.Flohr@t-online.de (Guido Flohr) writes:

> > |> rm /tmp/test/foo
> > |> 
> > |> it will return "ENOTDIR - Not a directory"
> > 
> > This is wrong.  It should return ENOENT as well.
> > 
> > Andreas.
> 
> Mea culpa, will get fixed.  Tomas: If you fix that yourself in your libc,
> don't fix unlink.c or remove.c but enoent.c; the same bug will probably
> strike if you try to open("/tmp/test/foo", ...).

I did a quick hack and let _enoent() always return 1 in my
version. Perhaps not a good solution, in general. 

Related to this, I found that _enoent() is not called in do_stat(), if
Fstat64() is used. The patch below does that.


Greetings,

Tomas


--- mintlib-0.55.3.orig/mintlib/do_stat.c	Thu Aug 31 20:37:17 2000
+++ mintlib-0.55.3/mintlib/do_stat.c	Sun Sep 10 19:04:31 2000
@@ -91,6 +91,9 @@
 			break;
 		default:
 			if (r < 0) {
+				if ((r == -ENOTDIR) && _enoent(path)) {
+					r = -ENOENT;
+				}
 				__set_errno (-r);
 				return -1;
 			}