* dtable.cc (dtable::set_file_pointers_for_exec): New function.
* dtable.h (dtable::set_file_pointers_for_exec): Declare new function. * spawn.cc (spawn_guts): Call dtable::set_file_pointers_for_exec to set pointers to EOF when execing non-cygwin applications.
This commit is contained in:
parent
e9350b6575
commit
fef1edbc9a
|
@ -1,3 +1,10 @@
|
||||||
|
2002-10-17 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* dtable.cc (dtable::set_file_pointers_for_exec): New function.
|
||||||
|
* dtable.h (dtable::set_file_pointers_for_exec): Declare new function.
|
||||||
|
* spawn.cc (spawn_guts): Call dtable::set_file_pointers_for_exec to set
|
||||||
|
pointers to EOF when execing non-cygwin applications.
|
||||||
|
|
||||||
2002-10-17 Robert Collins <rbtcollins@hotmail.com>
|
2002-10-17 Robert Collins <rbtcollins@hotmail.com>
|
||||||
|
|
||||||
* thread.h (pthread_mutex::isGoodInitializerOrBadObject): Declare.
|
* thread.h (pthread_mutex::isGoodInitializerOrBadObject): Declare.
|
||||||
|
|
|
@ -574,6 +574,17 @@ dtable::fixup_before_exec (DWORD target_proc_id)
|
||||||
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "fixup_before_exec");
|
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "fixup_before_exec");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
dtable::set_file_pointers_for_exec ()
|
||||||
|
{
|
||||||
|
SetResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "set_file_pointers_for_exec");
|
||||||
|
fhandler_base *fh;
|
||||||
|
for (size_t i = 0; i < size; i++)
|
||||||
|
if ((fh = fds[i]) != NULL && fh->get_flags () & O_APPEND)
|
||||||
|
SetFilePointer (fh->get_handle (), 0, 0, FILE_END);
|
||||||
|
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "fixup_before_exec");
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
dtable::fixup_after_exec (HANDLE parent)
|
dtable::fixup_after_exec (HANDLE parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,6 +78,7 @@ public:
|
||||||
operator fhandler_base **() {return fds;}
|
operator fhandler_base **() {return fds;}
|
||||||
void stdio_init ();
|
void stdio_init ();
|
||||||
void get_debugger_info ();
|
void get_debugger_info ();
|
||||||
|
void set_file_pointers_for_exec ();
|
||||||
};
|
};
|
||||||
|
|
||||||
void dtable_init (void);
|
void dtable_init (void);
|
||||||
|
|
|
@ -621,6 +621,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
|
||||||
|
|
||||||
cygbench ("spawn-guts");
|
cygbench ("spawn-guts");
|
||||||
|
|
||||||
|
cygheap->fdtab.set_file_pointers_for_exec ();
|
||||||
if (!cygheap->user.issetuid ())
|
if (!cygheap->user.issetuid ())
|
||||||
{
|
{
|
||||||
PSECURITY_ATTRIBUTES sec_attribs = sec_user_nih (sa_buf);
|
PSECURITY_ATTRIBUTES sec_attribs = sec_user_nih (sa_buf);
|
||||||
|
|
Loading…
Reference in New Issue