* fhandler.h (fhandler_base::hclose): New virtual method.
(fhandler_base::set_inheritance): Make this a method so that we can use the appropriate close methods. * fhandler.cc (fhandler_base::set_inheritance): Ditto. * path.cc (normalize_posix_path): Eliminate /. trailing path component.
This commit is contained in:
parent
f06a3648d5
commit
d7aac2acf5
@ -1,3 +1,12 @@
|
|||||||
|
Thu Apr 20 00:32:03 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* fhandler.h (fhandler_base::hclose): New virtual method.
|
||||||
|
(fhandler_base::set_inheritance): Make this a method so that we can use
|
||||||
|
the appropriate close methods.
|
||||||
|
* fhandler.cc (fhandler_base::set_inheritance): Ditto.
|
||||||
|
* path.cc (normalize_posix_path): Eliminate /. trailing path
|
||||||
|
component.
|
||||||
|
|
||||||
Wed Apr 20 0:19:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
Wed Apr 20 0:19:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* syscalls.cc (setuid): Allow switching user context after
|
* syscalls.cc (setuid): Allow switching user context after
|
||||||
|
@ -1427,8 +1427,8 @@ fhandler_pipe::lseek (off_t offset, int whence)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __stdcall
|
void
|
||||||
set_inheritance (HANDLE &h, int not_inheriting, const char *name)
|
fhandler_base::set_inheritance (HANDLE &h, int not_inheriting, const char *name)
|
||||||
{
|
{
|
||||||
HANDLE newh;
|
HANDLE newh;
|
||||||
|
|
||||||
@ -1438,16 +1438,17 @@ set_inheritance (HANDLE &h, int not_inheriting, const char *name)
|
|||||||
#ifndef DEBUGGING
|
#ifndef DEBUGGING
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CloseHandle (h);
|
hclose (h);
|
||||||
h = newh;
|
h = newh;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
else if (!name)
|
else if (!name)
|
||||||
{
|
{
|
||||||
CloseHandle (h);
|
hclose (h);
|
||||||
h = newh;
|
h = newh;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
/* FIXME: This won't work with sockets */
|
||||||
{
|
{
|
||||||
ForceCloseHandle2 (h, name);
|
ForceCloseHandle2 (h, name);
|
||||||
h = newh;
|
h = newh;
|
||||||
|
@ -235,6 +235,8 @@ public:
|
|||||||
const char *get_win32_name () { return win32_path_name_; }
|
const char *get_win32_name () { return win32_path_name_; }
|
||||||
unsigned long get_namehash () { return namehash_; }
|
unsigned long get_namehash () { return namehash_; }
|
||||||
|
|
||||||
|
virtual void hclose (HANDLE h) {CloseHandle (h);}
|
||||||
|
virtual void set_inheritance (HANDLE &h, int not_inheriting, const char *name = NULL);
|
||||||
|
|
||||||
/* fixup fd possibly non-inherited handles after fork */
|
/* fixup fd possibly non-inherited handles after fork */
|
||||||
void fork_fixup (HANDLE parent, HANDLE &h, const char *name);
|
void fork_fixup (HANDLE parent, HANDLE &h, const char *name);
|
||||||
@ -315,6 +317,7 @@ public:
|
|||||||
int ioctl (unsigned int cmd, void *);
|
int ioctl (unsigned int cmd, void *);
|
||||||
off_t lseek (off_t, int) { return 0; }
|
off_t lseek (off_t, int) { return 0; }
|
||||||
int close ();
|
int close ();
|
||||||
|
void hclose (HANDLE) {close ();}
|
||||||
|
|
||||||
select_record *select_read (select_record *s);
|
select_record *select_read (select_record *s);
|
||||||
select_record *select_write (select_record *s);
|
select_record *select_write (select_record *s);
|
||||||
@ -810,6 +813,4 @@ public:
|
|||||||
uid_t __stdcall get_file_owner (int, const char *);
|
uid_t __stdcall get_file_owner (int, const char *);
|
||||||
gid_t __stdcall get_file_group (int, const char *);
|
gid_t __stdcall get_file_group (int, const char *);
|
||||||
|
|
||||||
void __stdcall set_inheritance (HANDLE &h, int val, const char *name = NULL);
|
|
||||||
|
|
||||||
#endif /* _FHANDLER_H_ */
|
#endif /* _FHANDLER_H_ */
|
||||||
|
@ -619,6 +619,8 @@ normalize_posix_path (const char *cwd, const char *src, char *dst)
|
|||||||
++src;
|
++src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (dst > (dst_start + 1) && dst[-1] == '.' && SLASH_P (dst[-2]))
|
||||||
|
dst -= 2;
|
||||||
*dst = 0;
|
*dst = 0;
|
||||||
debug_printf ("%s = normalize_posix_path (%s)", dst_start, src_start);
|
debug_printf ("%s = normalize_posix_path (%s)", dst_start, src_start);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user