diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6e1ad17e2..0a79d6d0f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2005-01-31 Christopher Faylor + + * path.h (path_conv::set_name): Declare new function. + * path.cc (path_conv::set_name): Define new function. + * fhandler.h (fhandler_dev_null::open): Declare new function. + * fhandler.cc (fhandler_dev_null::open): Define new function. + 2005-01-31 Christopher Faylor * smallprint.c (rnarg): Use long rather than unsigned long so that we diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index ba539a33e..a58472b8c 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1421,6 +1421,15 @@ fhandler_dev_null::dump (void) paranoid_printf ("here"); } +int +fhandler_dev_null::open (int flags, mode_t mode) +{ + char posix[strlen (get_name ()) + 1]; + strcpy (posix, get_name ()); + pc.set_name ("NUL", posix); + return fhandler_base::open_9x (flags, mode); +} + void fhandler_base::set_no_inheritance (HANDLE &h, int not_inheriting) { diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 3879e067e..103404c02 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -951,6 +951,7 @@ class fhandler_dev_null: public fhandler_base { public: fhandler_dev_null (); + int open (int, mode_t); void dump (); select_record *select_read (select_record *s); diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 5d5d1eade..9705acd1a 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -942,6 +942,15 @@ out: #endif } +void +path_conv::set_name (const char *win32, const char *posix) +{ + if (!normalized_path_size && normalized_path) + cfree (normalized_path); + strcpy (path, win32); + set_normalized_path (posix, false); +} + path_conv::~path_conv () { if (!normalized_path_size && normalized_path) diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 569d4560d..f9d206670 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -191,6 +191,7 @@ class path_conv {path[0] = '\0';} ~path_conv (); + void set_name (const char *win32, const char *posix); inline char *get_win32 () { return path; } PUNICODE_STRING get_nt_native_path (UNICODE_STRING &upath); operator char *() {return path;}