From 6ea0c04e7ca613dbf28b5f913fe2d6f84ee7cbfc Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 31 Oct 2001 00:55:32 +0000 Subject: * cygheap.h (cygheap_fdmanip::cygheap_fdmanip): Clear fh. (cygheap_fdmanip::isopen): New method. * syscalls.cc (_read): Avoid accessing closed fd. * path.h (fe_types): New enum. (path_conv::set_path): New method. (find_exec): Change null_if_not_found argument to something more generic. * spawn.cc (find_exec): Default to returning the POSIX path rather than the windows path, unless instructed otherwise. (spawn_guts): Force call to find_exec to use native paths. * dlfcn.cc (check_path_access): Accommodate new find_exec arguments. * environ.h (win_env::get_posix): New method. --- winsup/cygwin/path.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/path.h') diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 6778e27a7..0f3409a75 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -136,6 +136,7 @@ class path_conv DWORD file_attributes () {return fileattr;} DWORD get_drive_type () {return drive_type;} BOOL fs_fast_ea () {return sym_opt & PC_CHECK_EA;} + void set_path (const char *p) {strcpy (path, p);} }; /* Symlink marker */ @@ -150,8 +151,18 @@ class path_conv #define MAX_LINK_DEPTH 10 int __stdcall slash_unc_prefix_p (const char *path) __attribute__ ((regparm(1))); -const char * __stdcall find_exec (const char *name, path_conv& buf, const char *winenv = "PATH=", - int null_if_notfound = 0, const char **known_suffix = NULL) __attribute__ ((regparm(3))); +enum fe_types +{ + FE_NADA = 0, /* Nothing special */ + FE_NNF = 1, /* Return NULL if not found */ + FE_NATIVE = 2, /* Return native path in path_conv struct */ + FE_CWD = 4 /* Search CWD for program */ +}; +const char * __stdcall find_exec (const char *name, path_conv& buf, + const char *winenv = "PATH=", + unsigned opt = FE_NADA, + const char **known_suffix = NULL) + __attribute__ ((regparm(3))); /* Common macros for checking for invalid path names */ #define isdrive(s) (isalpha (*(s)) && (s)[1] == ':') -- cgit v1.2.3