* environ.cc (_addenv): malloc space for setenv if cygwin1.dll is used in
conjunction with older binaries. (environ_init): Ditto. * external.cc (get_cygdrive_info): New function. * external.cc (get_cygdrive_prefixes): Change to use get_cygdrive_info but toss the user and system flags. * external.cc (cygwin_internal): Add new CW_GET_CYGDRIVE_INFO case. * path.cc (mount_info::get_cygdrive_prefixes): Remove method. * path.cc (mount_info::get_cygdrive_info): New method. Actually, get_cygdrive_info is really an enhanced version of get_cygdrive_prefixes renamed to get_cygdrive_info that also gets the user and system flags. * shared_info.h (get_cygdrive_prefixes): Remove method. * shared_info.h (get_cygdrive_info): New method. * include/cygwin/version.h: Bump minor API version due to adding CW_GET_CYGDRIVE_INFO to cygwin_internal. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_CYGDRIVE_INFO.
This commit is contained in:
@ -88,13 +88,24 @@ fillout_pinfo (pid_t pid, int winpid)
|
||||
}
|
||||
|
||||
static DWORD
|
||||
get_cygdrive_prefixes (char *user, char *system)
|
||||
get_cygdrive_info (char *user, char *system, char *user_flags,
|
||||
char *system_flags)
|
||||
{
|
||||
shared_info *info = cygwin_getshared();
|
||||
int res = info->mount.get_cygdrive_prefixes(user, system);
|
||||
int res = info->mount.get_cygdrive_info (user, system, user_flags,
|
||||
system_flags);
|
||||
return (res == ERROR_SUCCESS) ? 1 : 0;
|
||||
}
|
||||
|
||||
static DWORD
|
||||
get_cygdrive_prefixes (char *user, char *system)
|
||||
{
|
||||
char user_flags[MAX_PATH];
|
||||
char system_flags[MAX_PATH];
|
||||
DWORD res = get_cygdrive_info (user, system, user_flags, system_flags);
|
||||
return res;
|
||||
}
|
||||
|
||||
extern "C" DWORD
|
||||
cygwin_internal (cygwin_getinfo_types t, ...)
|
||||
{
|
||||
@ -151,6 +162,15 @@ cygwin_internal (cygwin_getinfo_types t, ...)
|
||||
init_exceptions ((exception_list *) arg);
|
||||
return 0;
|
||||
|
||||
case CW_GET_CYGDRIVE_INFO:
|
||||
{
|
||||
char *user = va_arg (arg, char *);
|
||||
char *system = va_arg (arg, char *);
|
||||
char *user_flags = va_arg (arg, char *);
|
||||
char *system_flags = va_arg (arg, char *);
|
||||
return get_cygdrive_info (user, system, user_flags, system_flags);
|
||||
}
|
||||
|
||||
default:
|
||||
return (DWORD) -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user