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>2006-01-03 20:44:26 +0300
committerChristopher Faylor <me@cgf.cx>2006-01-03 20:44:26 +0300
commitadcff8d159698ea0ff59505ada74fc7243738e68 (patch)
tree8efd16e71fdef6a230dcb316dbca01a4127fad0d /winsup/cygwin/dir.cc
parent825d0b93850125861ebefa6925ada44fe8f93f92 (diff)
* dir.cc (readdir_worker): Minor code cleanup.
* fhandler_console.cc (beep): Use a more Windows-generic wav file if the beep is missing. Use a more foolproof way to find out whether we should be recreating the missing key. * registry.h (reg_key::_disposition): New field. (reg_key::created): New function. * registry.cc (reg_key::reg_key): Set _disposition to zero by default. (reg_key::build_key): Fill in _disposition field.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r--winsup/cygwin/dir.cc103
1 files changed, 52 insertions, 51 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index 2e109083d..e00aa77ab 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -100,57 +100,58 @@ readdir_worker (DIR *dir, dirent *de)
}
}
- if (!res)
- if (!CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO)
- {
- de->__invalid_d_ino = 0;
- de->__ino32 = 0;
- if (de->d_name[0] == '.')
- {
- if (de->d_name[1] == '\0')
- dir->__flags |= dirent_saw_dot;
- else if (de->d_name[1] == '.' && de->d_name[2] == '\0')
- dir->__flags |= dirent_saw_dot_dot;
- }
- }
- else
- {
- /* Compute d_ino by combining filename hash with the directory hash
- (which was stored in dir->__d_dirhash when opendir was called). */
- if (de->d_name[0] == '.')
- {
- if (de->d_name[1] == '\0')
- {
- de->__invalid_d_ino = dir->__d_dirhash;
- dir->__flags |= dirent_saw_dot;
- }
- else if (de->d_name[1] != '.' || de->d_name[2] != '\0')
- goto hashit;
- else
- {
- dir->__flags |= dirent_saw_dot_dot;
- char *p, up[strlen (dir->__d_dirname) + 1];
- strcpy (up, dir->__d_dirname);
- if (!(p = strrchr (up, '\\')))
- goto hashit;
- *p = '\0';
- if (!(p = strrchr (up, '\\')))
- de->__invalid_d_ino = hash_path_name (0, ".");
- else
- {
- *p = '\0';
- de->__invalid_d_ino = hash_path_name (0, up);
- }
- }
- }
- else
- {
- hashit:
- __ino64_t dino = hash_path_name (dir->__d_dirhash, "\\");
- de->__invalid_d_ino = hash_path_name (dino, de->d_name);
- }
- de->__ino32 = de->__invalid_d_ino; // for legacy applications
- }
+ if (res)
+ /* error return */;
+ else if (!CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO)
+ {
+ de->__invalid_d_ino = 0;
+ de->__ino32 = 0;
+ if (de->d_name[0] == '.')
+ {
+ if (de->d_name[1] == '\0')
+ dir->__flags |= dirent_saw_dot;
+ else if (de->d_name[1] == '.' && de->d_name[2] == '\0')
+ dir->__flags |= dirent_saw_dot_dot;
+ }
+ }
+ else
+ {
+ /* Compute d_ino by combining filename hash with the directory hash
+ (which was stored in dir->__d_dirhash when opendir was called). */
+ if (de->d_name[0] == '.')
+ {
+ if (de->d_name[1] == '\0')
+ {
+ de->__invalid_d_ino = dir->__d_dirhash;
+ dir->__flags |= dirent_saw_dot;
+ }
+ else if (de->d_name[1] != '.' || de->d_name[2] != '\0')
+ goto hashit;
+ else
+ {
+ dir->__flags |= dirent_saw_dot_dot;
+ char *p, up[strlen (dir->__d_dirname) + 1];
+ strcpy (up, dir->__d_dirname);
+ if (!(p = strrchr (up, '\\')))
+ goto hashit;
+ *p = '\0';
+ if (!(p = strrchr (up, '\\')))
+ de->__invalid_d_ino = hash_path_name (0, ".");
+ else
+ {
+ *p = '\0';
+ de->__invalid_d_ino = hash_path_name (0, up);
+ }
+ }
+ }
+ else
+ {
+ hashit:
+ __ino64_t dino = hash_path_name (dir->__d_dirhash, "\\");
+ de->__invalid_d_ino = hash_path_name (dino, de->d_name);
+ }
+ de->__ino32 = de->__invalid_d_ino; // for legacy applications
+ }
return res;
}