equal
deleted
inserted
replaced
10 #define _ATFILE_SOURCE |
10 #define _ATFILE_SOURCE |
11 #include <Python.h> |
11 #include <Python.h> |
12 #include <fcntl.h> |
12 #include <fcntl.h> |
13 #include <stdio.h> |
13 #include <stdio.h> |
14 #include <string.h> |
14 #include <string.h> |
|
15 #include <errno.h> |
15 |
16 |
16 #ifdef _WIN32 |
17 #ifdef _WIN32 |
17 #include <windows.h> |
18 #include <windows.h> |
18 #include <io.h> |
19 #include <io.h> |
19 #else |
20 #else |
286 #ifdef AT_SYMLINK_NOFOLLOW |
287 #ifdef AT_SYMLINK_NOFOLLOW |
287 int dfd = -1; |
288 int dfd = -1; |
288 #endif |
289 #endif |
289 |
290 |
290 if (pathlen >= PATH_MAX) { |
291 if (pathlen >= PATH_MAX) { |
291 PyErr_SetString(PyExc_ValueError, "path too long"); |
292 errno = ENAMETOOLONG; |
|
293 PyErr_SetFromErrnoWithFilename(PyExc_OSError, path); |
292 goto error_value; |
294 goto error_value; |
293 } |
295 } |
294 strncpy(fullpath, path, PATH_MAX); |
296 strncpy(fullpath, path, PATH_MAX); |
295 fullpath[pathlen] = '/'; |
297 fullpath[pathlen] = '/'; |
296 |
298 |