delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/27/10:27:46

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Reply-To: <nhv AT cape DOT com>
From: "Norman Vine" <nhv AT cape DOT com>
To: <jacek AT certum DOT pl>
Cc: <cygwin AT cygwin DOT com>
Subject: RE: tcp_wrappers
Date: Tue, 27 Mar 2001 09:27:22 -0500
Message-ID: <006d01c0b6ca$0a0dcee0$a300a8c0@nhv>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2232.26
In-Reply-To: <3AC09B3E.DA198728@certum.pl>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200

Jacek Trzcinski writes:
>
>
>this was:
>
>if (errno < sys_nerr && errno > 0) 
>{
>strcpy(bp, sys_errlist[errno]);
>} else 
>{ 
>sprintf(bp, "Unknown error %d", errno);
>}
>
>
>I had to change to:
>
>if (errno < _sys_nerr && errno > 0) 
>{
>strcpy(bp, _sys_errlist[errno]);
>} else 
>{ 
>sprintf(bp, "Unknown error %d", errno);
>}


>Does anybody know it can be made simpler ( with minimal changes). It
>seems to be typical names problem. This changes I made looking at
>libcygwin.a
>and watching what are correct names of needed variables.

sure forget about the non-ANSII sys_errlist stuff
and just do

#include <errno.h>
#include <string.h>

   if( errno )
      strcpy( bp, strerror(errno));

Cheers

Norman Vine

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019