This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 20041225 and 20041227 snapshots not creating files with correct permissions


On Fri, Dec 31, 2004 at 01:34:14AM -0800, Yitzchak Scott-Thoennes wrote:
> With the 20041225 and 20041227 snapshots, the following program erroneously
> shows mode: 0100644.  20041224 and earlier correctly show mode: 0100640.
> 
> #include <stdio.h>
> #include <fcntl.h>
> #include <unistd.h>
> #include <sys/stat.h>
> 
> int main(int argc, char **argv)
> {
>   int fd;
>   struct stat s;
> 
>   (void)umask(0);
>   fd = open("foo", O_RDWR|O_CREAT|O_EXCL, 0640);
>   if (fd < 0) { perror("open failed"); }
>   if (close(fd)) { perror("close failed"); }
> 
>   if (stat("foo", &s)) { perror("stat failed"); }
>   printf("mode: 0%o\n", s.st_mode);
> 
>   if (unlink("foo")) { perror("unlink failed"); }
>   return 0;
> }

Seems to be corrected in the 20041231 snapshot, thanks.

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]