public inbox for rda@sourceware.org
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: rda@sources.redhat.com
Subject: RFA: avoid deprecated sys_nerr variable
Date: Tue, 19 Oct 2004 19:39:00 -0000	[thread overview]
Message-ID: <vt2hdoqlct2.fsf@zenia.home> (raw)


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);

             reply	other threads:[~2004-10-19 19:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19 19:39 Jim Blandy [this message]
2004-10-19 20:03 ` Kevin Buettner
2004-10-19 21:17   ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vt2hdoqlct2.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=rda@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).