Staging
v0.5.1
Revision 40b2e839246aa74f08eea1c2abb60e5ca93ecab0 authored by Jack Jansen on 21 July 2003, 22:11:07 UTC, committed by Jack Jansen on 21 July 2003, 22:11:07 UTC
This lead to a duplication of error messages (and installs). Fixes #764615.
1 parent a7203d1
Raw File
strerror.c

/* PD implementation of strerror() for systems that don't have it.
   Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */

#include <stdio.h>
#include "Python.h"

extern int sys_nerr;
extern char *sys_errlist[];

char *
strerror(int err)
{
	static char buf[20];
	if (err >= 0 && err < sys_nerr)
		return sys_errlist[err];
	PyOS_snprintf(buf, sizeof(buf), "Unknown errno %d", err);
	return buf;
}

#ifdef macintosh
int sys_nerr = 0;
char *sys_errlist[1] = 0;
#endif
back to top