Cygwin: pipe: Fix deadlock if pipe is created by non-cygwin app.
This commit is contained in:
parent
0b538118b2
commit
0063ffeb73
|
@ -1205,6 +1205,7 @@ public:
|
||||||
select_record *select_except (select_stuff *);
|
select_record *select_except (select_stuff *);
|
||||||
char *get_proc_fd_name (char *buf);
|
char *get_proc_fd_name (char *buf);
|
||||||
int open (int flags, mode_t mode = 0);
|
int open (int flags, mode_t mode = 0);
|
||||||
|
void open_setup (int flags);
|
||||||
void fixup_after_fork (HANDLE);
|
void fixup_after_fork (HANDLE);
|
||||||
int dup (fhandler_base *child, int);
|
int dup (fhandler_base *child, int);
|
||||||
int close ();
|
int close ();
|
||||||
|
|
|
@ -191,6 +191,19 @@ out:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fhandler_pipe::open_setup (int flags)
|
||||||
|
{
|
||||||
|
fhandler_base::open_setup (flags);
|
||||||
|
if (get_dev () == FH_PIPER && !read_mtx)
|
||||||
|
{
|
||||||
|
SECURITY_ATTRIBUTES *sa = sec_none_cloexec (flags);
|
||||||
|
read_mtx = CreateMutex (sa, FALSE, NULL);
|
||||||
|
if (!read_mtx)
|
||||||
|
debug_printf ("CreateMutex failed: %E");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
off_t
|
off_t
|
||||||
fhandler_pipe::lseek (off_t offset, int whence)
|
fhandler_pipe::lseek (off_t offset, int whence)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue