From 15346b69501aff03969f596430b1dc35d22b2006 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 31 Oct 2007 13:23:33 +0000 Subject: [PATCH] * external.cc (get_cygdrive_info): Make inline. (get_cygdrive_prefixes): Remove. (cygwin_internal): Call get_cygdrive_info with NULL flag parameters instead of get_cygdrive_prefixes. * path.cc (mount_info::get_cygdrive_info): Allow NULL flag parameters. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/external.cc | 13 ++----------- winsup/cygwin/path.cc | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3fa4f116f..3b70ef7f9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2007-10-31 Corinna Vinschen + + * external.cc (get_cygdrive_info): Make inline. + (get_cygdrive_prefixes): Remove. + (cygwin_internal): Call get_cygdrive_info with NULL flag parameters + instead of get_cygdrive_prefixes. + * path.cc (mount_info::get_cygdrive_info): Allow NULL flag parameters. + 2007-10-30 Corinna Vinschen * fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't remove diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index b6b64f14d..ea7ae114e 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -109,7 +109,7 @@ fillout_pinfo (pid_t pid, int winpid) return &ep; } -static DWORD +static inline DWORD get_cygdrive_info (char *user, char *system, char *user_flags, char *system_flags) { @@ -118,15 +118,6 @@ get_cygdrive_info (char *user, char *system, char *user_flags, return (res == ERROR_SUCCESS) ? 1 : 0; } -static DWORD -get_cygdrive_prefixes (char *user, char *system) -{ - char user_flags[CYG_MAX_PATH]; - char system_flags[CYG_MAX_PATH]; - DWORD res = get_cygdrive_info (user, system, user_flags, system_flags); - return res; -} - static DWORD check_ntsec (const char *filename) { @@ -211,7 +202,7 @@ cygwin_internal (cygwin_getinfo_types t, ...) { char *user = va_arg (arg, char *); char *system = va_arg (arg, char *); - return get_cygdrive_prefixes (user, system); + return get_cygdrive_info (user, system, NULL, NULL); } case CW_GETPINFO_FULL: diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 6720f1d6b..a10a29339 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2379,7 +2379,7 @@ mount_info::get_cygdrive_info (char *user, char *system, char* user_flags, int res = r.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, user, CYG_MAX_PATH, ""); /* Get the user flags, if appropriate */ - if (res == ERROR_SUCCESS) + if (user_flags && res == ERROR_SUCCESS) { int flags = r.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_CYGDRIVE | MOUNT_BINARY); strcpy (user_flags, (flags & MOUNT_BINARY) ? "binmode" : "textmode"); @@ -2390,7 +2390,7 @@ mount_info::get_cygdrive_info (char *user, char *system, char* user_flags, int res2 = r2.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, system, CYG_MAX_PATH, ""); /* Get the system flags, if appropriate */ - if (res2 == ERROR_SUCCESS) + if (system_flags && res2 == ERROR_SUCCESS) { int flags = r2.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_CYGDRIVE | MOUNT_BINARY); strcpy (system_flags, (flags & MOUNT_BINARY) ? "binmode" : "textmode"); -- 2.43.5