From 341d29542235fd18b184b5bffb02d06e3b1e0fab Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 27 Sep 2003 05:44:58 +0000 Subject: [PATCH] * path.cc (symlink_info::check): Use new introducer for mknod'ed files. (parse_device): Ditto. * syscalls.cc (mknod_worker): Ditto. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/path.cc | 4 ++-- winsup/cygwin/syscalls.cc | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 17fb66334..6f09fbd08 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2003-09-27 Christopher Faylor + + * path.cc (symlink_info::check): Use new introducer for mknod'ed files. + (parse_device): Ditto. + * syscalls.cc (mknod_worker): Ditto. + 2003-09-27 Christopher Faylor * devices.shilka: Add /dev/sda disk devices. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index d1e31ad9c..241660885 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2880,7 +2880,7 @@ symlink_info::parse_device (const char *contents) _major_t myminor; _mode_t mymode; - mymajor = strtol (++contents, &endptr, 16); + mymajor = strtol (contents += 2, &endptr, 16); if (endptr == contents) return false; @@ -3016,7 +3016,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt) res = check_shortcut (suffix.path, fileattr, h, contents, &error, &pflags); if (!res) /* check more below */; - else if (*contents == ':' && parse_device (contents)) + else if (contents[0] == ':' && contents[1] == '\\' && parse_device (contents)) goto file_not_symlink; else break; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 51ce08e2f..8c53af20e 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2033,8 +2033,8 @@ static int __stdcall mknod_worker (const char *path, mode_t type, mode_t mode, _major_t major, _minor_t minor) { - char buf[sizeof (":00000000:00000000:00000000") + MAX_PATH]; - sprintf (buf, ":%x:%x:%x", major, minor, + char buf[sizeof (":\\00000000:00000000:00000000") + MAX_PATH]; + sprintf (buf, ":\\%x:%x:%x", major, minor, type | (mode & (S_IRWXU | S_IRWXG | S_IRWXO))); return symlink_worker (buf, path, true, true); } -- 2.43.5