* configure.in: Check whether we need to prototype strerror.
* server.h: Optionally prototype strerror. * gdbreplay.c (perror_with_name): Use strerror. * linux-low.c (linux_attach_lwp): Use strerror. * utils.c (perror_with_name): Use strerror. * config.in, configure: Regenerated.
This commit is contained in:
parent
7cfbef4774
commit
43d5792ce1
8 changed files with 104 additions and 39 deletions
|
@ -33,16 +33,13 @@ void
|
|||
perror_with_name (char *string)
|
||||
{
|
||||
#ifndef STDC_HEADERS
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
extern int errno;
|
||||
#endif
|
||||
const char *err;
|
||||
char *combined;
|
||||
|
||||
if (errno < sys_nerr)
|
||||
err = sys_errlist[errno];
|
||||
else
|
||||
err = strerror (errno);
|
||||
if (err == NULL)
|
||||
err = "unknown error";
|
||||
|
||||
combined = (char *) alloca (strlen (err) + strlen (string) + 3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue