mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Wed Aug 30 16:44:55 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/mach/hurd/select.c: Deal with out of order replies during io_select request loop. Handle MACH_RCV_TIMED_OUT error from requests. * hurd/intr-msg.c: If the user passed the MACH_RCV_TIMEOUT option, distinguish MACH_RCV_TIMED_OUT from EINTR. * posix/glob.c (glob): Use realloc to extend strings for GLOB_MARK slash. (glob_in_dir): Don't allocate extra byte here. * sysdeps/i386/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC): Decrement the DT_RELSZ value for the skipped reloc.
This commit is contained in:
15
ChangeLog
15
ChangeLog
@@ -1,3 +1,18 @@
|
|||||||
|
Wed Aug 30 16:44:55 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* sysdeps/mach/hurd/select.c: Deal with out of order replies
|
||||||
|
during io_select request loop.
|
||||||
|
Handle MACH_RCV_TIMED_OUT error from requests.
|
||||||
|
* hurd/intr-msg.c: If the user passed the MACH_RCV_TIMEOUT option,
|
||||||
|
distinguish MACH_RCV_TIMED_OUT from EINTR.
|
||||||
|
|
||||||
|
* posix/glob.c (glob): Use realloc to extend strings for GLOB_MARK
|
||||||
|
slash.
|
||||||
|
(glob_in_dir): Don't allocate extra byte here.
|
||||||
|
|
||||||
|
* sysdeps/i386/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC):
|
||||||
|
Decrement the DT_RELSZ value for the skipped reloc.
|
||||||
|
|
||||||
Tue Aug 29 12:35:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
Tue Aug 29 12:35:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
* time/australasia: Updated data from ADO.
|
* time/australasia: Updated data from ADO.
|
||||||
|
@@ -35,6 +35,9 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
|
|||||||
{
|
{
|
||||||
struct hurd_sigstate *ss = _hurd_self_sigstate ();
|
struct hurd_sigstate *ss = _hurd_self_sigstate ();
|
||||||
error_t err;
|
error_t err;
|
||||||
|
/* Notice now if the user requested a timeout. OPTION may have the bit
|
||||||
|
added by interruption semantics, and we must distinguish. */
|
||||||
|
int user_timeout = option & MACH_RCV_TIMEOUT;
|
||||||
|
|
||||||
/* Tell the signal thread that we are doing an interruptible RPC on
|
/* Tell the signal thread that we are doing an interruptible RPC on
|
||||||
this port. If we get a signal and should return EINTR, the signal
|
this port. If we get a signal and should return EINTR, the signal
|
||||||
@@ -64,6 +67,15 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
|
|||||||
|
|
||||||
switch (err)
|
switch (err)
|
||||||
{
|
{
|
||||||
|
case MACH_RCV_TIMED_OUT:
|
||||||
|
if (user_timeout)
|
||||||
|
/* The real user RPC timed out. */
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
/* The operation was supposedly interrupted, but still has
|
||||||
|
not returned. Declare it interrupted. */
|
||||||
|
goto interrupted;
|
||||||
|
|
||||||
case MACH_SEND_INTERRUPTED: /* RPC didn't get out. */
|
case MACH_SEND_INTERRUPTED: /* RPC didn't get out. */
|
||||||
if (ss->intr_port != MACH_PORT_NULL)
|
if (ss->intr_port != MACH_PORT_NULL)
|
||||||
/* If this signal was for us and it should interrupt calls, the
|
/* If this signal was for us and it should interrupt calls, the
|
||||||
@@ -78,10 +90,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
|
|||||||
so the signal thread destroyed the reply port. */
|
so the signal thread destroyed the reply port. */
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
case MACH_RCV_TIMED_OUT:
|
interrupted:
|
||||||
/* The operation was supposedly interrupted, but still has
|
|
||||||
not returned. Declare it interrupted. */
|
|
||||||
|
|
||||||
err = EINTR;
|
err = EINTR;
|
||||||
|
|
||||||
/* The EINTR return indicates cancellation, so clear the flag. */
|
/* The EINTR return indicates cancellation, so clear the flag. */
|
||||||
@@ -95,7 +104,9 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
|
|||||||
/* This signal or cancellation was for us. We need to wait for
|
/* This signal or cancellation was for us. We need to wait for
|
||||||
the reply, but not hang forever. */
|
the reply, but not hang forever. */
|
||||||
option |= MACH_RCV_TIMEOUT;
|
option |= MACH_RCV_TIMEOUT;
|
||||||
timeout = _hurd_interrupted_rpc_timeout;
|
/* Never decrease the user's timeout. */
|
||||||
|
if (!user_timeout || timeout > _hurd_interrupted_rpc_timeout)
|
||||||
|
timeout = _hurd_interrupted_rpc_timeout;
|
||||||
}
|
}
|
||||||
goto message; /* Retry the receive. */
|
goto message; /* Retry the receive. */
|
||||||
|
|
||||||
|
16
posix/glob.c
16
posix/glob.c
@@ -417,7 +417,17 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
for (i = oldcount; i < pglob->gl_pathc; ++i)
|
for (i = oldcount; i < pglob->gl_pathc; ++i)
|
||||||
if (__lstat (pglob->gl_pathv[i], &st) == 0 &&
|
if (__lstat (pglob->gl_pathv[i], &st) == 0 &&
|
||||||
S_ISDIR (st.st_mode))
|
S_ISDIR (st.st_mode))
|
||||||
strcat (pglob->gl_pathv[i], "/");
|
{
|
||||||
|
size_t len = strlen (pglob->gl_pathv[i]) + 2;
|
||||||
|
char *new = realloc (pglob->gl_pathv[i], len);
|
||||||
|
if (new == NULL)
|
||||||
|
{
|
||||||
|
globfree (pglob);
|
||||||
|
return GLOB_NOSPACE;
|
||||||
|
}
|
||||||
|
strcpy (&new[len - 2], "/");
|
||||||
|
pglob->gl_pathv[i] = new;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & GLOB_NOSORT))
|
if (!(flags & GLOB_NOSORT))
|
||||||
@@ -617,7 +627,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
|||||||
if (len == 0)
|
if (len == 0)
|
||||||
len = strlen (name);
|
len = strlen (name);
|
||||||
new->name
|
new->name
|
||||||
= (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
|
= (char *) malloc (len + 1);
|
||||||
if (new->name == NULL)
|
if (new->name == NULL)
|
||||||
goto memory_error;
|
goto memory_error;
|
||||||
memcpy ((__ptr_t) new->name, name, len);
|
memcpy ((__ptr_t) new->name, name, len);
|
||||||
@@ -635,7 +645,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
|||||||
nfound = 1;
|
nfound = 1;
|
||||||
names = (struct globlink *) __alloca (sizeof (struct globlink));
|
names = (struct globlink *) __alloca (sizeof (struct globlink));
|
||||||
names->next = NULL;
|
names->next = NULL;
|
||||||
names->name = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
|
names->name = (char *) malloc (len + 1);
|
||||||
if (names->name == NULL)
|
if (names->name == NULL)
|
||||||
goto memory_error;
|
goto memory_error;
|
||||||
memcpy (names->name, pattern, len);
|
memcpy (names->name, pattern, len);
|
||||||
|
@@ -66,6 +66,7 @@ elf_machine_load_address (void)
|
|||||||
we skip it to avoid trying to modify read-only text in this early stage. */
|
we skip it to avoid trying to modify read-only text in this early stage. */
|
||||||
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
|
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
|
||||||
++(const Elf32_Rel *) (dynamic_info)[DT_REL]->d_un.d_ptr;
|
++(const Elf32_Rel *) (dynamic_info)[DT_REL]->d_un.d_ptr;
|
||||||
|
(dynamic_info)[DT_RELSZ]->d_un.d_val -= sizeof (Elf32_Rel);
|
||||||
|
|
||||||
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
|
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
|
||||||
MAP is the object containing the reloc. */
|
MAP is the object containing the reloc. */
|
||||||
|
@@ -121,16 +121,39 @@ DEFUN(__select, (nfds, readfds, writefds, exceptfds, timeout),
|
|||||||
if (!err)
|
if (!err)
|
||||||
{
|
{
|
||||||
int tag = i;
|
int tag = i;
|
||||||
|
int type = types[i];
|
||||||
err = __io_select (ports[i], port,
|
err = __io_select (ports[i], port,
|
||||||
/* Poll for each but the last. */
|
/* Poll for each but the last. */
|
||||||
(i == lastfd && got == 0) ? to : 0,
|
(i == lastfd && got == 0) ? to : 0,
|
||||||
&types[i], &tag);
|
&type, &tag);
|
||||||
if (!err)
|
switch (err)
|
||||||
{
|
{
|
||||||
if (tag != i)
|
case MACH_RCV_TIMED_OUT:
|
||||||
|
/* No immediate response. This is normal. */
|
||||||
|
err = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
/* We got an answer. This is not necessarily the answer to
|
||||||
|
the query we sent just now. It may correspond to any
|
||||||
|
prior query which timed out before its answer arrived. */
|
||||||
|
if (tag < 0 || tag > i ||
|
||||||
|
(type & (SELECT_READ|SELECT_URG|SELECT_WRITE)) == 0)
|
||||||
|
/* This is not a proper answer to any query we have yet
|
||||||
|
made. */
|
||||||
err = EGRATUITOUS;
|
err = EGRATUITOUS;
|
||||||
else if (types[i] & (SELECT_READ|SELECT_URG|SELECT_WRITE))
|
else
|
||||||
++got;
|
{
|
||||||
|
/* Some port is ready. TAG tells us which. */
|
||||||
|
types[tag] &= type;
|
||||||
|
++got;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
/* Any other error kills us.
|
||||||
|
But we must continue to loop to free the ports. */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_hurd_port_free (&cells[i]->port, &ulink[i], ports[i]);
|
_hurd_port_free (&cells[i]->port, &ulink[i], ports[i]);
|
||||||
|
Reference in New Issue
Block a user