Skip to content

Commit

Permalink
Add my_strerror back
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Jun 6, 2024
1 parent d12d33c commit 6e02a94
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions gcc/gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ static char dir_separator_str[] = {DIR_SEPARATOR, 0};
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME)
#endif

extern char *my_strerror PROTO((int));

#ifndef HAVE_KILL
#define kill(p,s) raise(s)
#endif
Expand Down Expand Up @@ -1085,7 +1087,13 @@ translate_options (argcp, argvp)
*argvp = newv;
*argcp = newindex;
}


char *
my_strerror(e)
int e;
{
return strerror(e);
}

static char *
skip_whitespace (p)
Expand Down Expand Up @@ -5284,14 +5292,14 @@ static void
pfatal_with_name (name)
char *name;
{
fatal ("%s: %s", name, strerror (errno));
fatal ("%s: %s", name, my_strerror (errno));
}

static void
perror_with_name (name)
char *name;
{
error ("%s: %s", name, strerror (errno));
error ("%s: %s", name, my_strerror (errno));
}

static void
Expand All @@ -5309,7 +5317,7 @@ pfatal_pexecute (errmsg_fmt, errmsg_arg)
errmsg_fmt = msg;
}

fatal ("%s: %s", errmsg_fmt, strerror (save_errno));
fatal ("%s: %s", errmsg_fmt, my_strerror (save_errno));
}

/* More 'friendly' abort that prints the line and file.
Expand Down

0 comments on commit 6e02a94

Please sign in to comment.