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
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-07-24 09:37:47 +0400
committerChristopher Faylor <me@cgf.cx>2002-07-24 09:37:47 +0400
commit99138976d9f0e9f94e9920af5e61ace9fd5554df (patch)
tree317a5dc50db8febc6e0cc603627c58f669b3c423 /winsup
parent63a93e9dd606b8760bf9bb26320978629c8f45a1 (diff)
* path.cc (path_conv::check): Always set fileattr when component == 0.
(readlink): Use path_conv method rather than field. * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto, throughout. * path.h (path_conv): Make fileattr private. * exceptions.cc (try_to_debug): Default to idle priority when looping.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog9
-rw-r--r--winsup/cygwin/exceptions.cc2
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc6
-rw-r--r--winsup/cygwin/path.cc14
-rw-r--r--winsup/cygwin/path.h6
5 files changed, 22 insertions, 15 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 40bbf682c..cefd7e750 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,12 @@
+2002-07-24 Christopher Faylor <cgf@redhat.com>
+
+ * path.cc (path_conv::check): Always set fileattr when component == 0.
+ (readlink): Use path_conv method rather than field.
+ * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto,
+ throughout.
+ * path.h (path_conv): Make fileattr private.
+ * exceptions.cc (try_to_debug): Default to idle priority when looping.
+
2002-07-23 Corinna Vinschen <corinna@vinschen.de>
* fhandler_serial.cc: Use must_init_serial_line capability throughout.
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 764ae5a84..f907b21a4 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -391,9 +391,9 @@ try_to_debug (bool waitloop)
system_printf ("Failed to start debugger: %E");
else
{
+ SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE);
if (!waitloop)
return 1;
- SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE);
while (!being_debugged ())
/* spin */;
Sleep (4000);
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 95081f061..738416fbf 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -260,7 +260,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
buf->st_mode = 0;
/* Using a side effect: get_file_attibutes checks for
directory. This is used, to set S_ISVTX, if needed. */
- if (pc->fileattr & FILE_ATTRIBUTE_DIRECTORY)
+ if (pc->isdir ())
buf->st_mode = S_IFDIR;
else if (pc->issymlink ())
buf->st_mode = S_IFLNK;
@@ -273,7 +273,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
&uid, &gid) == 0)
{
/* If read-only attribute is set, modify ntsec return value */
- if ((pc->fileattr & FILE_ATTRIBUTE_READONLY) && !get_symlink_p ())
+ if (pc->has_attribute (FILE_ATTRIBUTE_READONLY) && !get_symlink_p ())
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
if (!(buf->st_mode & S_IFMT))
@@ -283,7 +283,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
{
buf->st_mode |= STD_RBITS;
- if (!(pc->fileattr & FILE_ATTRIBUTE_READONLY))
+ if (!pc->has_attribute (FILE_ATTRIBUTE_READONLY))
buf->st_mode |= STD_WBITS;
/* | S_IWGRP | S_IWOTH; we don't give write to group etc */
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index c09b4591f..f4527afd8 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -447,7 +447,6 @@ path_conv::check (const char *src, unsigned opt,
error = 0;
else if ((error = check_null_empty_str (src)))
return;
-
/* This loop handles symlink expansion. */
for (;;)
{
@@ -603,7 +602,10 @@ path_conv::check (const char *src, unsigned opt,
if (!(opt & PC_SYM_IGNORE))
{
if (!component)
- path_flags = sym.pflags;
+ {
+ fileattr = sym.fileattr;
+ path_flags = sym.pflags;
+ }
/* If symlink.check found an existing non-symlink file, then
it sets the appropriate flag. It also sets any suffix found
@@ -612,10 +614,7 @@ path_conv::check (const char *src, unsigned opt,
{
error = sym.error;
if (component == 0)
- {
- fileattr = sym.fileattr;
- add_ext_from_sym (sym);
- }
+ add_ext_from_sym (sym);
if (pcheck_case == PCHECK_RELAXED)
goto out; // file found
/* Avoid further symlink evaluation. Only case checks are
@@ -633,7 +632,6 @@ path_conv::check (const char *src, unsigned opt,
if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW))
{
set_symlink (); // last component of path is a symlink.
- fileattr = sym.fileattr;
if (opt & PC_SYM_CONTENTS)
{
strcpy (path, sym.contents);
@@ -3072,7 +3070,7 @@ readlink (const char *path, char *buf, int buflen)
if (!pathbuf.issymlink ())
{
- if (pathbuf.fileattr != INVALID_FILE_ATTRIBUTES)
+ if (pathbuf.exists ())
set_errno (EINVAL);
return -1;
}
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index 3d9b86c15..f9f55035e 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -70,6 +70,7 @@ struct fs_info
class path_conv
{
char path[MAX_PATH];
+ DWORD fileattr;
fs_info fs;
void add_ext_from_sym (symlink_info&);
public:
@@ -79,7 +80,6 @@ class path_conv
int error;
DWORD devn;
int unit;
- DWORD fileattr;
BOOL case_clash;
char *normalized_path;
@@ -138,8 +138,8 @@ class path_conv
check (src, opt | PC_NULLEMPTY, suffixes);
}
- path_conv (): path_flags (0), known_suffix (NULL), error (0), devn (0),
- unit (0), fileattr (INVALID_FILE_ATTRIBUTES),
+ path_conv (): fileattr (INVALID_FILE_ATTRIBUTES), path_flags (0),
+ known_suffix (NULL), error (0), devn (0), unit (0),
normalized_path (NULL) {path[0] = '\0';}
inline char *get_win32 () { return path; }