Changeset 3451
- Timestamp:
- Jun 16, 2007, 3:42:59 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/dev-lang/python/Modules/posixmodule.c
r3435 r3451 406 406 Py_DECREF(v); 407 407 } 408 #ifdef LIBPATHSTRICT 409 buffer[0] = buffer[1] = buffer[2] = buffer[3] = '\0'; 410 rc = DosQueryExtLIBPATH(buffer, LIBPATHSTRICT); 411 if (rc == NO_ERROR) { /* (not a typo, envname is NOT 'LIBPATH_STRICT') */ 412 PyObject *v = PyString_FromString(buffer); 413 PyDict_SetItemString(d, "LIBPATHSTRICT", v); 414 Py_DECREF(v); 415 } 416 #endif 408 417 } 409 418 #endif … … 1950 1959 return d; 1951 1960 1952 #elif defined(PYOS_OS2) 1961 #elif defined(PYOS_OS2) && !defined(__KLIBC__) 1953 1962 1954 1963 #ifndef MAX_PATH … … 2800 2809 #if defined(PYOS_OS2) 2801 2810 /* Omit Pseudo-Env Vars that Would Confuse Programs if Passed On */ 2802 if (stricmp(k, "BEGINLIBPATH") != 0 && stricmp(k, "ENDLIBPATH") != 0) { 2811 if (stricmp(k, "BEGINLIBPATH") != 0 && stricmp(k, "ENDLIBPATH") != 0 2812 && stricmp(k, "LIBPATHSTRICT") != 0) { 2803 2813 #endif 2804 2814 len = PyString_Size(key) + PyString_Size(val) + 2; … … 4021 4031 struct pipe_ref p_fd[3]; 4022 4032 FILE *p_s[3]; 4023 int file_count, i, pipe_err, pipe_pid ;4033 int file_count, i, pipe_err, pipe_pid = -1; 4024 4034 char *shell, *sh_name, *opt, *rd_mode, *wr_mode; 4025 4035 PyObject *f, *p_f[3]; … … 6116 6126 posix_pipe(PyObject *self, PyObject *noargs) 6117 6127 { 6118 #if defined(PYOS_OS2) 6128 #if defined(PYOS_OS2) && !defined(__KLIBC__) 6119 6129 HFILE read, write; 6120 6130 APIRET rc; … … 6322 6332 if (rc != NO_ERROR) 6323 6333 return os2_error(rc); 6334 #ifdef LIBPATHSTRICT 6335 } else if (stricmp(s1, "LIBPATHSTRICT") == 0) { 6336 APIRET rc; 6337 6338 rc = DosSetExtLIBPATH(s2, LIBPATHSTRICT); 6339 if (rc != NO_ERROR) 6340 return os2_error(rc); 6341 #endif 6324 6342 } else { 6325 #endif 6343 #endif /* OS2 */ 6326 6344 6327 6345 /* XXX This can leak memory -- not easy to fix :-( */ … … 8267 8285 APIRET rc; 8268 8286 ULONG values[QSV_MAX+1]; 8269 PyObject *v;8270 8287 char *ver, tmp[50]; 8271 8288 … … 8296 8313 default: 8297 8314 PyOS_snprintf(tmp, sizeof(tmp), 8298 "% d-%d", values[QSV_VERSION_MAJOR],8315 "%ld-%ld", values[QSV_VERSION_MAJOR], 8299 8316 values[QSV_VERSION_MINOR]); 8300 8317 ver = &tmp[0];
Note:
See TracChangeset
for help on using the changeset viewer.