diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-03-09 12:07:51 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-03-09 12:07:51 +0000 |
commit | 12086329d8fffdb656559fcc3fe451ffcf696780 (patch) | |
tree | 34f286f3a9f477b99c0dce3c4434889316076a9a /Python/errors.c | |
parent | d877c096c77892aad2dae32e34bf2ec018a2ce10 (diff) | |
download | cpython-12086329d8fffdb656559fcc3fe451ffcf696780.tar.gz |
Patch #494045: patches errno and stat to cope on plan9.
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index 13b3d11ed6..3869b1cc5c 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -264,6 +264,9 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) PyObject *v; char *s; int i = errno; +#ifdef PLAN9 + char errbuf[ERRMAX]; +#endif #ifdef MS_WIN32 char *s_buf = NULL; #endif @@ -271,6 +274,10 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) if (i == EINTR && PyErr_CheckSignals()) return NULL; #endif +#ifdef PLAN9 + rerrstr(errbuf, sizeof errbuf); + s = errbuf; +#else if (i == 0) s = "Error"; /* Sometimes errno didn't get set */ else @@ -305,7 +312,8 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename) s[--len] = '\0'; } } -#endif +#endif /* Unix/Windows */ +#endif /* PLAN 9*/ if (filename != NULL) v = Py_BuildValue("(iss)", i, s, filename); else |