This is the mail archive of the
rda@sources.redhat.com
mailing list for the rda project.
RFA: avoid deprecated sys_nerr variable
- From: Jim Blandy <jimb at redhat dot com>
- To: rda at sources dot redhat dot com
- Date: 19 Oct 2004 14:37:13 -0500
- Subject: RFA: avoid deprecated sys_nerr variable
2004-10-12 Jim Blandy <jimb@redhat.com>
* ptrace-target.c (ptrace_create_child): Don't use sys_nerr to
check that errno is in a valid range. The use sys_nerr is
deprecated on GNU/Linux, and according to the ISO C standard and
POSIX, strerror always returns a valid string, even for invalid
errno codes.
Index: rda/unix/ptrace-target.c
===================================================================
RCS file: /cvs/src/src/rda/unix/ptrace-target.c,v
retrieving revision 1.6
diff -c -r1.6 ptrace-target.c
*** rda/unix/ptrace-target.c 19 Mar 2004 18:26:08 -0000 1.6
--- rda/unix/ptrace-target.c 12 Oct 2004 23:17:56 -0000
***************
*** 122,129 ****
sleep (-1); /* FIXME ??? */
fprintf (stderr, "Cannot exec %s: %s.\n", process->executable,
! errno > 0 && errno < sys_nerr ?
! strerror (errno) : "unknown error");
fail:
fflush (stderr);
_exit (0177);
--- 122,128 ----
sleep (-1); /* FIXME ??? */
fprintf (stderr, "Cannot exec %s: %s.\n", process->executable,
! strerror (errno));
fail:
fflush (stderr);
_exit (0177);