Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-05-03 03:58:20 +0400
committerChristopher Faylor <me@cgf.cx>2002-05-03 03:58:20 +0400
commit3bb7eb449cb21012ce47b70dce789f98005c36fd (patch)
treec8248c695f93e08b81232cb02ab9c0d347bb4a92
parentd055ecb08fc71f22444c8930eef1894142a96b03 (diff)
* fhandler_proc.cc (fhandler_proc::fstat): Prime with information from
fhandler_base::fstat. Use defines rather than constants for permission settings.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/fhandler_process.cc13
2 files changed, 13 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 626a52901..ed3bff290 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-02 Christopher Faylor <cgf@redhat.com>
+
+ * fhandler_proc.cc (fhandler_proc::fstat): Prime with information from
+ fhandler_base::fstat. Use defines rather than constants for permission
+ settings.
+
2002-04-30 Eric Blake <ebb9@email.byu.edu>
* path.cc (hash_path_name): Improve hash function strength.
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 32812c5b8..b05e07bf0 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -78,26 +78,27 @@ fhandler_process::fhandler_process ():
}
int
-fhandler_process::fstat (struct __stat64 *buf, path_conv *path)
+fhandler_process::fstat (struct __stat64 *buf, path_conv *pc)
{
int file_type = exists ((const char *) get_name ());
+ (void) fhandler_base::fstat (buf, pc);
+ buf->st_mode &= ~_IFMT & NO_W;
+
switch (file_type)
{
case 0:
set_errno (ENOENT);
return -1;
case 1:
- buf->st_mode = S_IFDIR | 0555;
- buf->st_nlink = 1;
+ buf->st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
return 0;
case 2:
- buf->st_mode = S_IFDIR | 0555;
+ buf->st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
buf->st_nlink = PROCESS_LINK_COUNT;
return 0;
default:
case -1:
- buf->st_mode = S_IFREG | 0444;
- buf->st_nlink = 1;
+ buf->st_mode |= S_IFREG;
return 0;
}
}