* exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if there

is a tty associated with the process.  Send SIGHUP on CTRL_LOGOFF_EVENT.
* fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open handle
counter regardless of whether this is a pty or tty.
(fhandler_tty_slave::open): Ditto.
(fhandler_tty_slave::dup): Ditto.
(fhandler_tty_common::set_close_on_exec): Ditto.
(fhandler_tty_master::init_console): Decrement console open handle counter
after init since it will now be handled by all tty open.
* syscalls.cc (setsid): Rework debugging output slightly.
This commit is contained in:
Christopher Faylor 2003-07-26 04:53:59 +00:00
parent ddb6762155
commit df04ae29b2
14 changed files with 231 additions and 223 deletions

View File

@ -1,3 +1,18 @@
2003-07-26 Christopher Faylor <cgf@redhat.com>
* exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if
there is a tty associated with the process. Send SIGHUP on
CTRL_LOGOFF_EVENT.
* fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open
handle counter regardless of whether this is a pty or tty.
(fhandler_tty_slave::open): Ditto.
(fhandler_tty_slave::dup): Ditto.
(fhandler_tty_common::set_close_on_exec): Ditto.
(fhandler_tty_master::init_console): Decrement console open handle
counter after init since it will now be handled by all tty open.
* syscalls.cc (setsid): Rework debugging output slightly.
2003-07-25 Christopher Faylor <cgf@redhat.com>
* configure.in: Use 'install-sh -c'.

View File

@ -923,25 +923,29 @@ setup_handler (int sig, void *handler, struct sigaction& siga)
static BOOL WINAPI
ctrl_c_handler (DWORD type)
{
if (type == CTRL_LOGOFF_EVENT)
return TRUE;
static bool saw_close;
/* Return FALSE to prevent an "End task" dialog box from appearing
for each Cygwin process window that's open when the computer
is shut down or console window is closed. */
if (type == CTRL_SHUTDOWN_EVENT)
{
#if 0
/* Don't send a signal. Only NT service applications and their child
processes will receive this event and the services typically already
processes will receive this event and the services typically already
handle the shutdown action when getting the SERVICE_CONTROL_SHUTDOWN
control message. */
sig_send (NULL, SIGTERM);
#endif
return FALSE;
}
if (type == CTRL_CLOSE_EVENT)
if (myself->ctty != -1
&& (type == CTRL_CLOSE_EVENT || (!saw_close && type == CTRL_LOGOFF_EVENT)))
{
if (type == CTRL_CLOSE_EVENT)
saw_close = true;
sig_send (NULL, SIGHUP);
return FALSE;
}

View File

@ -226,7 +226,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
/* Although the documentation indicates otherwise, it seems like
"inodes" on these devices are persistent, at least across reboots. */
buf->st_ino = (((__ino64_t) nFileIndexHigh) << 32)
| (__ino64_t) nFileIndexLow;
| (__ino64_t) nFileIndexLow;
break;
default:
/* Either the nFileIndex* fields are unreliable or unavailable. Use the

View File

@ -639,30 +639,30 @@ format_proc_cpuinfo (char *destbuf, size_t maxsize)
bufptr += __small_sprintf (bufptr, "vendor_id : %s\n", szBuffer);
read_value ("Identifier", REG_SZ);
bufptr += __small_sprintf (bufptr, "identifier : %s\n", szBuffer);
if (wincap.is_winnt ())
{
if (wincap.is_winnt ())
{
read_value ("~Mhz", REG_DWORD);
bufptr += __small_sprintf (bufptr, "cpu MHz : %u\n", *(DWORD *) szBuffer);
print ("flags :");
if (IsProcessorFeaturePresent (PF_3DNOW_INSTRUCTIONS_AVAILABLE))
print (" 3dnow");
print (" 3dnow");
if (IsProcessorFeaturePresent (PF_COMPARE_EXCHANGE_DOUBLE))
print (" cx8");
print (" cx8");
if (!IsProcessorFeaturePresent (PF_FLOATING_POINT_EMULATED))
print (" fpu");
print (" fpu");
if (IsProcessorFeaturePresent (PF_MMX_INSTRUCTIONS_AVAILABLE))
print (" mmx");
print (" mmx");
if (IsProcessorFeaturePresent (PF_PAE_ENABLED))
print (" pae");
print (" pae");
if (IsProcessorFeaturePresent (PF_RDTSC_INSTRUCTION_AVAILABLE))
print (" tsc");
print (" tsc");
if (IsProcessorFeaturePresent (PF_XMMI_INSTRUCTIONS_AVAILABLE))
print (" sse");
print (" sse");
if (IsProcessorFeaturePresent (PF_XMMI64_INSTRUCTIONS_AVAILABLE))
print (" sse2");
print (" sse2");
}
}
}
else
{
bufptr += __small_sprintf (bufptr, "processor : %d\n", cpu_number);
@ -671,12 +671,12 @@ format_proc_cpuinfo (char *destbuf, size_t maxsize)
maxf &= 0xffff;
vendor_id[3] = 0;
bufptr += __small_sprintf (bufptr, "vendor_id : %s\n", (char *)vendor_id);
unsigned cpu_mhz = 0;
if (wincap.is_winnt ())
{
unsigned cpu_mhz = 0;
if (wincap.is_winnt ())
{
read_value ("~Mhz", REG_DWORD);
cpu_mhz = *(DWORD *)szBuffer;
}
}
if (maxf >= 1)
{
unsigned features2, features1, extra_info, cpuid_sig;
@ -722,10 +722,10 @@ format_proc_cpuinfo (char *destbuf, size_t maxsize)
// could implement a lookup table here if someone needs it
strcpy (szBuffer, "unknown");
}
if (wincap.is_winnt ())
{
bufptr += __small_sprintf (bufptr, "type : %s\n"
"cpu family : %d\n"
if (wincap.is_winnt ())
{
bufptr += __small_sprintf (bufptr, "type : %s\n"
"cpu family : %d\n"
"model : %d\n"
"model name : %s\n"
"stepping : %d\n"
@ -744,28 +744,28 @@ format_proc_cpuinfo (char *destbuf, size_t maxsize)
apic_id,
cpu_mhz,
(features1 & (1 << 0)) ? "yes" : "no");
}
else
{
bufptr += __small_sprintf (bufptr, "type : %s\n"
"cpu family : %d\n"
"model : %d\n"
"model name : %s\n"
"stepping : %d\n"
"brand id : %d\n"
"cpu count : %d\n"
"apic id : %d\n"
"fpu : %s\n",
type_str,
family,
model,
szBuffer,
stepping,
brand_id,
cpu_count,
apic_id,
(features1 & (1 << 0)) ? "yes" : "no");
}
}
else
{
bufptr += __small_sprintf (bufptr, "type : %s\n"
"cpu family : %d\n"
"model : %d\n"
"model name : %s\n"
"stepping : %d\n"
"brand id : %d\n"
"cpu count : %d\n"
"apic id : %d\n"
"fpu : %s\n",
type_str,
family,
model,
szBuffer,
stepping,
brand_id,
cpu_count,
apic_id,
(features1 & (1 << 0)) ? "yes" : "no");
}
print ("flags :");
if (features1 & (1 << 0))
print (" fpu");

View File

@ -49,7 +49,7 @@ secret_event_name (char *buf, short port, int *secret_ptr)
{
__small_sprintf (buf, "%scygwin.local_socket.secret.%d.%08x-%08x-%08x-%08x",
wincap.has_terminal_services () ? "Global\\" : "",
port,
port,
secret_ptr [0], secret_ptr [1],
secret_ptr [2], secret_ptr [3]);
}

View File

@ -555,25 +555,22 @@ fhandler_tty_slave::open (path_conv *, int flags, mode_t)
set_output_handle (to_master_local);
set_open_status ();
if (!output_done_event)
if (fhandler_console::open_fhs++ == 0 && !output_done_event
&& wincap.pty_needs_alloc_console ())
{
if (fhandler_console::open_fhs++ == 0
&& wincap.pty_needs_alloc_console ())
BOOL b;
HWINSTA h = CreateWindowStation (NULL, 0, GENERIC_READ | GENERIC_WRITE, &sec_none_nih);
termios_printf ("CreateWindowStation %p, %E", h);
if (h)
{
BOOL b;
HWINSTA h = CreateWindowStation (NULL, 0, GENERIC_READ | GENERIC_WRITE, &sec_none_nih);
termios_printf ("CreateWindowStation %p, %E", h);
if (h)
{
b = SetProcessWindowStation (h);
termios_printf ("SetProcessWindowStation %d, %E", b);
}
b = AllocConsole (); // will cause flashing if workstation
// stuff fails
termios_printf ("%d = AllocConsole ()", b);
b = SetProcessWindowStation (h);
termios_printf ("SetProcessWindowStation %d, %E", b);
}
termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
b = AllocConsole (); // will cause flashing if workstation
// stuff fails
termios_printf ("%d = AllocConsole ()", b);
}
termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
termios_printf ("tty%d opened", ttynum);
return 1;
@ -582,12 +579,9 @@ fhandler_tty_slave::open (path_conv *, int flags, mode_t)
int
fhandler_tty_slave::close ()
{
if (!output_done_event)
{
if (!--fhandler_console::open_fhs && myself->ctty == -1)
FreeConsole ();
termios_printf ("decremented open_fhs %d", fhandler_console::open_fhs);
}
if (!--fhandler_console::open_fhs && myself->ctty == -1)
FreeConsole ();
termios_printf ("decremented open_fhs %d", fhandler_console::open_fhs);
return fhandler_tty_common::close ();
}
@ -855,11 +849,8 @@ fhandler_tty_slave::read (void *ptr, size_t& len)
int
fhandler_tty_slave::dup (fhandler_base *child)
{
if (!output_done_event)
{
fhandler_console::open_fhs++;
termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
}
fhandler_console::open_fhs++;
termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
return fhandler_tty_common::dup (child);
}
@ -1253,11 +1244,8 @@ fhandler_tty_common::set_close_on_exec (int val)
void
fhandler_tty_slave::fixup_after_fork (HANDLE parent)
{
if (!output_done_event)
{
fhandler_console::open_fhs++;
termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
}
fhandler_console::open_fhs++;
termios_printf ("incremented open_fhs %d", fhandler_console::open_fhs);
fhandler_tty_common::fixup_after_fork (parent);
}
@ -1317,6 +1305,7 @@ fhandler_tty_master::init_console ()
return -1;
console->init (INVALID_HANDLE_VALUE, GENERIC_READ | GENERIC_WRITE, O_BINARY);
fhandler_console::open_fhs--; /* handled when individual fds are opened */
console->set_r_no_interrupt (1);
return 0;
}

View File

@ -45,7 +45,7 @@ ftok (const char *path, int id)
to increase and reveal more bit usage.
Implementation details: dev_t is 32bits, but is formed by
device(32bits) << 16 | unit(32bits)
device(32bits) << 16 | unit(32bits)
But device is ACTUALLY == status & FH_DEVMASK, where FH_DEVMASK
is 0x00000fff --> 12 bits

View File

@ -843,7 +843,7 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access,
if (!base && !(flags & MAP_FIXED))
base = MapViewOfFileEx (h, access, high, low, len, NULL);
debug_printf ("%x = MapViewOfFileEx (h:%x, access:%x, 0, off:%D, "
"len:%u, addr:%x)", base, h, access, off, len, *addr);
"len:%u, addr:%x)", base, h, access, off, len, *addr);
if (!base || ((flags & MAP_FIXED) && base != *addr))
{
if (!base)

View File

@ -522,7 +522,7 @@ fdsock (int &fd, const char *name, SOCKET soc)
debug_printf ("not setting socket inheritance since winsock2_active %d",
winsock2_active);
fhandler_socket *fh = (fhandler_socket *)
cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name, NULL,
cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name, NULL,
tolower (name[5]) - 'a');
if (!fh)
return NULL;
@ -775,14 +775,14 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen)
{
bool was_blocking = false;
if (!fh->is_nonblocking ())
{
{
int nonblocking = 1;
fh->ioctl (FIONBIO, &nonblocking);
was_blocking = true;
}
res = fh->connect (name, namelen);
if (was_blocking)
{
{
if (res == -1 && get_errno () == EINPROGRESS)
{
size_t fds_size = howmany (fd + 1, NFDBITS) * sizeof (fd_mask);
@ -794,7 +794,7 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen)
FD_SET (fd, except_fds);
res = cygwin_select (fd + 1, NULL, write_fds, except_fds, NULL);
if (res > 0 && FD_ISSET (fd, except_fds))
{
{
res = -1;
for (;;)
{
@ -803,7 +803,7 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen)
cygwin_getsockopt (fd, SOL_SOCKET, SO_ERROR,
(void *) &err, &len);
if (err)
{
{
set_errno (err);
break;
}
@ -811,9 +811,9 @@ cygwin_connect (int fd, const struct sockaddr *name, int namelen)
}
}
else if (res > 0)
res = 0;
res = 0;
else
{
{
WSASetLastError (WSAEINPROGRESS);
set_winsock_errno ();
}

View File

@ -757,7 +757,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, BOOL *pintern)
debug_printf ("GetTokenInformation(my_token, TokenGroups): %E");
else if (!groups.issetgroups ()) /* setgroups was never called */
ret = sid_in_token_groups (my_grps, groups.pgsid)
|| groups.pgsid == usersid;
|| groups.pgsid == usersid;
else /* setgroups was called */
{
struct __group32 *gr;
@ -1430,15 +1430,15 @@ get_nt_object_attribute (HANDLE handle, SE_OBJECT_TYPE object_type,
psd = (PSECURITY_DESCRIPTOR) & sd_buf[0];
DWORD len = sizeof (sd_buf);
if (ERROR_SUCCESS != RegGetKeySecurity ((HKEY) handle,
DACL_SECURITY_INFORMATION |
GROUP_SECURITY_INFORMATION |
OWNER_SECURITY_INFORMATION,
psd, &len))
{
__seterrno ();
debug_printf ("RegGetKeySecurity %E");
psd = NULL;
}
DACL_SECURITY_INFORMATION |
GROUP_SECURITY_INFORMATION |
OWNER_SECURITY_INFORMATION,
psd, &len))
{
__seterrno ();
debug_printf ("RegGetKeySecurity %E");
psd = NULL;
}
}
else
{
@ -1447,7 +1447,7 @@ get_nt_object_attribute (HANDLE handle, SE_OBJECT_TYPE object_type,
GROUP_SECURITY_INFORMATION |
OWNER_SECURITY_INFORMATION,
NULL, NULL, NULL, NULL, &psd))
{
{
__seterrno ();
debug_printf ("GetSecurityInfo %E");
psd = NULL;

View File

@ -284,14 +284,14 @@ setsid (void)
{
if (myself->ctty >= 0 && fhandler_console::open_fhs <= 0)
{
syscall_printf ("open_fhs %d, freeing console",
fhandler_console::open_fhs);
syscall_printf ("freeing console");
FreeConsole ();
}
myself->ctty = -1;
myself->sid = getpid ();
myself->pgid = getpid ();
syscall_printf ("sid %d, pgid %d, ctty %d", myself->sid, myself->pgid, myself->ctty);
syscall_printf ("sid %d, pgid %d, ctty %d, open_fhs %d", myself->sid,
myself->pgid, myself->ctty, fhandler_console::open_fhs);
return myself->sid;
}
@ -2105,7 +2105,7 @@ seteuid32 (__uid32_t uid)
if (usersid != (origpsid = cygheap->user.orig_sid ()))
psid2 = usersid;
if (sec_acl ((PACL) dacl_buf, FALSE, origpsid, psid2))
{
{
TOKEN_DEFAULT_DACL tdacl;
tdacl.DefaultDacl = (PACL) dacl_buf;
if (!SetTokenInformation (ptok, TokenDefaultDacl,
@ -2562,7 +2562,7 @@ logout (char *line)
/* Writing to wtmp must be atomic to prevent mixed up data. */
char mutex_name[MAX_PATH];
HANDLE mutex = CreateMutex (NULL, FALSE,
shared_name (mutex_name, "wtmp_mutex", 0));
shared_name (mutex_name, "wtmp_mutex", 0));
if (mutex)
while (WaitForSingleObject (mutex, INFINITE) == WAIT_ABANDONED)
;
@ -2603,11 +2603,11 @@ internal_setutent (bool force_readwrite)
case we try again for reading only unless the process calls
pututline() (==force_readwrite) in which case opening just fails. */
if (utmp_fd < 0 && !force_readwrite)
{
{
utmp_fd = open (utmp_file, O_RDONLY | O_BINARY);
if (utmp_fd >= 0)
utmp_readonly = true;
}
}
}
else
lseek (utmp_fd, 0, SEEK_SET);
@ -2653,7 +2653,7 @@ getutent ()
{
internal_setutent (false);
if (utmp_fd < 0)
return NULL;
return NULL;
}
if (read (utmp_fd, &utmp_data, sizeof utmp_data) != sizeof utmp_data)
return NULL;
@ -2670,7 +2670,7 @@ getutid (struct utmp *id)
{
internal_setutent (false);
if (utmp_fd < 0)
return NULL;
return NULL;
}
while (read (utmp_fd, &utmp_data, sizeof utmp_data) == sizeof utmp_data)
{
@ -2707,7 +2707,7 @@ getutline (struct utmp *line)
{
internal_setutent (false);
if (utmp_fd < 0)
return NULL;
return NULL;
}
while (read (utmp_fd, &utmp_data, sizeof utmp_data) == sizeof utmp_data)
{
@ -2754,18 +2754,18 @@ extern "C"
long gethostid(void)
{
unsigned data[13] = {0x92895012,
0x10293412,
0x29602018,
0x81928167,
0x34601329,
0x75630198,
0x89860395,
0x62897564,
0x00194362,
0x20548593,
0x96839102,
0x12219854,
0x00290012};
0x10293412,
0x29602018,
0x81928167,
0x34601329,
0x75630198,
0x89860395,
0x62897564,
0x00194362,
0x20548593,
0x96839102,
0x12219854,
0x00290012};
bool has_cpuid = false;
sigframe thisframe (mainthread);
@ -2780,12 +2780,12 @@ long gethostid(void)
{
debug_printf ("486 processor");
if (can_set_flag (0x00200000))
{
debug_printf ("processor supports CPUID instruction");
has_cpuid = true;
}
{
debug_printf ("processor supports CPUID instruction");
has_cpuid = true;
}
else
debug_printf ("processor does not support CPUID instruction");
debug_printf ("processor does not support CPUID instruction");
}
if (has_cpuid)
{
@ -2793,22 +2793,22 @@ long gethostid(void)
cpuid (&maxf, &unused[0], &unused[1], &unused[2], 0);
maxf &= 0xffff;
if (maxf >= 1)
{
unsigned features;
cpuid (&data[0], &unused[0], &unused[1], &features, 1);
if (features & (1 << 18))
{
debug_printf ("processor has psn");
if (maxf >= 3)
{
cpuid (&unused[0], &unused[1], &data[1], &data[2], 3);
debug_printf ("Processor PSN: %04x-%04x-%04x-%04x-%04x-%04x",
data[0] >> 16, data[0] & 0xffff, data[2] >> 16, data[2] & 0xffff, data[1] >> 16, data[1] & 0xffff);
}
}
else
debug_printf ("processor does not have psn");
}
{
unsigned features;
cpuid (&data[0], &unused[0], &unused[1], &features, 1);
if (features & (1 << 18))
{
debug_printf ("processor has psn");
if (maxf >= 3)
{
cpuid (&unused[0], &unused[1], &data[1], &data[2], 3);
debug_printf ("Processor PSN: %04x-%04x-%04x-%04x-%04x-%04x",
data[0] >> 16, data[0] & 0xffff, data[2] >> 16, data[2] & 0xffff, data[1] >> 16, data[1] & 0xffff);
}
}
else
debug_printf ("processor does not have psn");
}
}
UUID Uuid;
@ -2822,8 +2822,8 @@ long gethostid(void)
// Unfortunately Windows will sometimes pick a virtual Ethernet card
// e.g. VMWare Virtual Ethernet Adaptor
debug_printf ("MAC address of first Ethernet card: %02x:%02x:%02x:%02x:%02x:%02x",
Uuid.Data4[2], Uuid.Data4[3], Uuid.Data4[4],
Uuid.Data4[5], Uuid.Data4[6], Uuid.Data4[7]);
Uuid.Data4[2], Uuid.Data4[3], Uuid.Data4[4],
Uuid.Data4[5], Uuid.Data4[6], Uuid.Data4[7]);
}
else
{
@ -2839,16 +2839,16 @@ long gethostid(void)
GetDiskFreeSpace ("C:\\", NULL, NULL, NULL, (DWORD *)&data[11]);
debug_printf ("hostid entropy: %08x %08x %08x %08x "
"%08x %08x %08x %08x "
"%08x %08x %08x %08x "
"%08x",
data[0], data[1],
data[2], data[3],
data[4], data[5],
data[6], data[7],
data[8], data[9],
data[10], data[11],
data[12]);
"%08x %08x %08x %08x "
"%08x %08x %08x %08x "
"%08x",
data[0], data[1],
data[2], data[3],
data[4], data[5],
data[6], data[7],
data[8], data[9],
data[10], data[11],
data[12]);
long hostid = 0x40291372;
// a random hashing algorithm

View File

@ -856,8 +856,8 @@ pthread_cond::pthread_cond (pthread_condattr *attr) :
if (attr)
if (attr->shared != PTHREAD_PROCESS_PRIVATE)
{
magic = 0;
return;
magic = 0;
return;
}
verifyable_mutex_obj = &mtx_in;
@ -918,19 +918,19 @@ pthread_cond::unblock (const bool all)
unsigned long released;
if (!pending)
{
/*
* Block incoming threads until all waiting threads are released.
*/
mtx_in.lock ();
{
/*
* Block incoming threads until all waiting threads are released.
*/
mtx_in.lock ();
/*
* Calculate releaseable again because threads can enter until
* the semaphore has been taken, but they can not leave, therefore pending
* is unchanged and releaseable can only get higher
*/
releaseable = waiting - pending;
}
/*
* Calculate releaseable again because threads can enter until
* the semaphore has been taken, but they can not leave, therefore pending
* is unchanged and releaseable can only get higher
*/
releaseable = waiting - pending;
}
released = all ? releaseable : 1;
pending += released;
@ -980,11 +980,11 @@ pthread_cond::wait (pthread_mutex_t mutex, DWORD dwMilliseconds)
* If the thread gets one than a signal|broadcast is in progress.
*/
if (WaitForSingleObject (sem_wait, 0) == WAIT_OBJECT_0)
/*
* thread got cancelled ot timed out while a signalling is in progress.
* Set wait result back to signaled
*/
rv = WAIT_OBJECT_0;
/*
* thread got cancelled ot timed out while a signalling is in progress.
* Set wait result back to signaled
*/
rv = WAIT_OBJECT_0;
}
InterlockedDecrement ((long *)&waiting);
@ -1068,8 +1068,8 @@ pthread_rwlock::pthread_rwlock (pthread_rwlockattr *attr) :
if (attr)
if (attr->shared != PTHREAD_PROCESS_PRIVATE)
{
magic = 0;
return;
magic = 0;
return;
}
if (!pthread_mutex::is_good_object (&verifyable_mutex_obj))
@ -1162,12 +1162,12 @@ pthread_rwlock::tryrdlock ()
{
struct RWLOCK_READER *reader = new struct RWLOCK_READER;
if (reader)
{
reader->thread = self;
add_reader (reader);
}
{
reader->thread = self;
add_reader (reader);
}
else
result = EAGAIN;
result = EAGAIN;
}
mtx.unlock ();
@ -1237,10 +1237,10 @@ pthread_rwlock::unlock ()
if (writer)
{
if (writer != self)
{
result = EPERM;
goto DONE;
}
{
result = EPERM;
goto DONE;
}
writer = NULL;
}
@ -1249,10 +1249,10 @@ pthread_rwlock::unlock ()
struct RWLOCK_READER *reader = lookup_reader (self);
if (!reader)
{
result = EPERM;
goto DONE;
}
{
result = EPERM;
goto DONE;
}
remove_reader (reader);
delete reader;
@ -1336,13 +1336,13 @@ pthread_rwlock::_fixup_after_fork ()
while (*temp)
{
if ((*temp)->thread == self)
temp = &((*temp)->next);
temp = &((*temp)->next);
else
{
struct RWLOCK_READER *cur = *temp;
*temp = (*temp)->next;
delete cur;
}
{
struct RWLOCK_READER *cur = *temp;
*temp = (*temp)->next;
delete cur;
}
}
}