Ignore:
Timestamp:
Mar 23, 1998, 7:51:40 PM (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
01518357
Parents:
98bcbda3
Message:

Converted to conditionally uses strerr code to better work with glibc2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/hppa1.1/simhppa/tools/print_dump.c

    r98bcbda3 r5839b0c1  
    2828#include <memory.h>
    2929#include <stdarg.h>
     30
     31#include "../../../../../../build-tools/src/config.h"
     32
     33#ifndef VMS
     34#ifndef HAVE_STRERROR
     35#if defined(__linux__) && (__GLIBC__ < 2)
     36extern char *sys_errlist[];
     37#endif
     38
     39#define strerror( _err ) \
     40  ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
     41
     42#else   /* HAVE_STRERROR */
     43char *strerror ();
     44#endif
     45#else   /* VMS */
     46char *strerror (int,...);
     47#endif
    3048
    3149#define Failed(x)       (((int) (x)) == -1)
     
    281299    va_list arglist;
    282300    register char *format;
    283     extern char *sys_errlist[];
    284     extern int sys_nerr;
    285301    int local_errno;
    286302
     
    300316
    301317    if (local_errno)
    302         if ((local_errno > 0) && (local_errno < sys_nerr))
    303             (void) fprintf(stderr, " (%s)\n", sys_errlist[local_errno]);
    304         else
    305             (void) fprintf(stderr, " (unknown errno=%d)\n", local_errno);
     318      (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
    306319    else
    307         (void) fprintf(stderr, "\n");
     320      (void) fprintf(stderr, "\n");
    308321
    309322    (void) fflush(stderr);
Note: See TracChangeset for help on using the changeset viewer.