rm prints no errmsg if _unlink fails with errno 32
Reini Urban
rurban@x-ray.at
Tue Jun 1 17:57:00 GMT 2004
NTFS problems with _unlink
(latest cygwin release 1.5.10-3 and fileutils-4.1-2)
rm printed no errmsg if _unlink failed with errno 32.
The file was still there.
$ touch xx
$ chmod 400 xx
$ rm xx
# prints a (localized) warning and prompt without the rm -f parameter.
# which seems to be the expected behaviour.
Now to the problem:
I was not really able to reproduce this filesystem problem.
ERROR_SHARING_VIOLATION
This is the most relevant part, which should be enough IMHO.
Nothing was printed, even if _unlink failed with lasterr 32.
$ strace rm -f xx
...
43 74997 [main] rm 2136 unlink: _unlink (v:\xx)
213 75210 [main] rm 2136 unlink: couldn't delete file, err 32
74 75284 [main] rm 2136 unlink: 0 = unlink (/www/xx)
...
$ grep ERROR /usr/include/w32api/win*.h|grep " 32"
/usr/include/w32api/winbase.h:#define HINSTANCE_ERROR 32
/usr/include/w32api/winerror.h:#define ERROR_SHARING_VIOLATION 32L
cgf's changes to syscalls.cc rev.1.127 seem to check against this problem.
So the culprit seems to be phumblet's user_shared->delqueue stuff.
user_shared->delqueue.queue_file() at line 233.
/* Add file to the "to be deleted" queue. */
And delqueue.cc has a prominent FIXME.
"this delqueue module is very flawed and should be rewritten.
First, having an array of a fixed size for keeping track of the
unlinked but not yet deleted files is bad. Second, someprograms
will unlink files and then create a new one in the same location
and this behavior is not supported in the current code.
Probably
we should find a move/rename function that will work on open
files, and move delqueue files to some special location or some
such hack..."
Please issue a warning if deletion from the "to be deleted" queue fails.
From the source I see that either "Still using %s" or
"Hmm, don't know what to do with '%s', %E" should have been printed.
Unfortunately I didn't save the strace dump, so I cannot say which
message appeared in the strace. Anyway, nothing was printed to the console.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.rurban
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040601/8acb9727/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list