comparison Python/errors.c @ 2376:c31eaed7798b legacy-trunk

rename macstrerror to PyMac_StrError; no EINTR test in CW
author Guido van Rossum <guido@python.org>
date Sat, 18 Feb 1995 14:52:19 +0000
parents b40e10bda231
children d5978238e3ba
comparison
equal deleted inserted replaced
2375:51c8824985f8 2376:c31eaed7798b
58 #include "allobjects.h" 58 #include "allobjects.h"
59 #include "traceback.h" 59 #include "traceback.h"
60 60
61 #include <errno.h> 61 #include <errno.h>
62 62
63 #ifndef NT 63 #ifdef __CFM68K__
64 #pragma lib_export on
65 #endif
66
64 #ifdef macintosh 67 #ifdef macintosh
65 /* 68 /* Replace strerror with a Mac specific routine.
66 ** For the mac, there's a function macstrerror in macosmodule.c. We can't 69 XXX PROBLEM: some positive errors have a meaning for MacOS,
67 ** call it strerror(), though, since that is already defined (for Think C) 70 but some library routines set Unix error numbers...
68 ** in ANSI
69 */ 71 */
70 #undef strerror 72 #undef strerror
71 #define strerror macstrerror 73 #define strerror PyMac_StrError
72 #include "macdefs.h" /* For CW to find EINTR */ 74 #endif /* macintosh */
73 #endif /* !macintosh */ 75
76 #ifndef NT
74 extern char *strerror PROTO((int)); 77 extern char *strerror PROTO((int));
75 #endif /* !NT */ 78 #endif /* !NT */
76 79
77 /* Last exception stored by err_setval() */ 80 /* Last exception stored by err_setval() */
78 81
173 err_errno(exc) 176 err_errno(exc)
174 object *exc; 177 object *exc;
175 { 178 {
176 object *v; 179 object *v;
177 int i = errno; 180 int i = errno;
181 #ifdef EINTR
178 if (i == EINTR && sigcheck()) 182 if (i == EINTR && sigcheck())
179 return NULL; 183 return NULL;
184 #endif
180 v = mkvalue("(is)", i, strerror(i)); 185 v = mkvalue("(is)", i, strerror(i));
181 if (v != NULL) { 186 if (v != NULL) {
182 err_setval(exc, v); 187 err_setval(exc, v);
183 DECREF(v); 188 DECREF(v);
184 } 189 }