Mail Archives: cygwin/2005/04/02/16:50:28
Hi,
[Note, when replying personally to me instead of the list, *don't*
remove the nospam part in my addy, it's valid as-is.]
I just upgraded to cygwin 1.5.13, and since I did so, the utime() system
call stopped working on my Windows 98 system. It returns a "permission
denied" error when it should succeed instead. Prior to 1.5.12 it was
working fine. It also still works fine using the -mno-cygwin option to
gcc to bypass cygwin.
The only related questions to this I've found using Google or searching
the mailing list archives relate to NT permissions, which don't apply on
Windows 98. As a result, setting nontea or nontsec in CYGWIN makes no
difference. The drive in question in a FAT32 partition mounted as
/cygdrive/d, but the problem occurs for the / partition as well as SMB
mounted drives as well.
The following test file reproduces the bug (test.c)
---8<---
#include <stdlib.h>
#include <errno.h>
#include <utime.h>
int main() {
struct utimbuf x;
x.actime = time(NULL) + 600;
x.modtime= time(NULL) + 1200;
int ret = utime("foo", &x);
printf("ret = %d, foo: %s\n", ret, strerror(errno));
return 0;
}
---8<---
Using 1.5.12 or 1.5.13:
BASH-2.05b$ gcc -o test test.c
BASH-2.05b$ ls -l foo
ls: foo: No such file or directory
BASH-2.05b$ ./test
ret = -1, foo: No such file or directory
BASH-2.05b$ echo > foo
BASH-2.05b$ ./test
ret = -1, foo: Permission denied
BASH-2.05b$ gcc -o test test.c -mno-cygwin
BASH-2.05b$ ./test
ret = 0, foo: No error
BASH-2.05b$
The first error is expected and correct since `foo' doesn't exist at
first. The second error is new in 1.5.12 and is wrong. I do have
permission to do anything to `foo', as evidenced by the fact that I
could create and write to it using `echo'.
The same sequence using 1.5.11:
BASH-2.05b$ gcc -o test test.c
BASH-2.05b$ ls -l foo
ls: foo: No such file or directory
BASH-2.05b$ ./test
ret = -1, foo: No such file or directory
BASH-2.05b$ echo > foo
BASH-2.05b$ ./test
ret = 0, foo: No error
BASH-2.05b$ gcc -o test test.c -mno-cygwin
BASH-2.05b$ ./test
ret = 0, foo: No error
BASH-2.05b$
Again, the first error is expected and correct. Note how the second
command returns "No error" as it should, but doesn't, in 1.5.12&13.
In both cases, -mno-cygwin gives the expected behaviour too, so I can
only conclude that this must be a bug in cygwin itself.
For reference, the output of cygcheck -s -v -r -h for both versions can
be found here:
http://joesbox.cjb.net/~jdrexler/cygcheck-1.5.11.txt
http://joesbox.cjb.net/~jdrexler/cygcheck-1.5.13.txt
Any clues?
--
Josef Drexler | http://jdrexler.com/home/
---------------------------------+----------------------------------------
Please help Conserve Gravity | Email address is *valid*.
Use tape&glue, no paperweights | Don't remove the "nospam" 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/
- Raw text -