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

[MiNT] bug in unlink/MiNTLib?

I've recently compiled fileutils using MiNTLib 0.55.3, and noticed a
small problem, which I think is related to MiNTLib, and not

The problem is that wrong error code is returned from MiNTLib's
unlink() in certain cases.

Assume that the folder /tmp/ exists, but /tmp/test/ does not. Also
assume that the file /tmp/foo does not exist. If I then write:

rm /tmp/foo

it will return "ENOENT - No such file or directory", which is
correct. However, if I write:

rm /tmp/test/foo

it will return "ENOTDIR - Not a directory", since /tmp/test is assumed
by unlink() to be a directory, but it doesn't exist.

The problem occurs when "rm -f" is used, which tells rm to ignore the
ENOENT error message. "rm -f /tmp/test/foo" doesn't ignore the error
message, however, and the command fails, even if it shouldn't.

Older versions of rm (from KGMD), don't know what MiNTLib it uses,
does not have this problem.