Changeset 3451


Ignore:
Timestamp:
Jun 16, 2007, 3:42:59 PM (18 years ago)
Author:
bird
Message:

LIBPATHSTRICT, use opendir and not DosFindFirst, and removed a three warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/essentials/dev-lang/python/Modules/posixmodule.c

    r3435 r3451  
    406406            Py_DECREF(v);
    407407        }
     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
    408417    }
    409418#endif
     
    19501959        return d;
    19511960
    1952 #elif defined(PYOS_OS2)
     1961#elif defined(PYOS_OS2) && !defined(__KLIBC__)
    19531962
    19541963#ifndef MAX_PATH
     
    28002809#if defined(PYOS_OS2)
    28012810        /* 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) {
    28032813#endif
    28042814                len = PyString_Size(key) + PyString_Size(val) + 2;
     
    40214031        struct pipe_ref p_fd[3];
    40224032        FILE *p_s[3];
    4023         int file_count, i, pipe_err, pipe_pid;
     4033        int file_count, i, pipe_err, pipe_pid = -1;
    40244034        char *shell, *sh_name, *opt, *rd_mode, *wr_mode;
    40254035        PyObject *f, *p_f[3];
     
    61166126posix_pipe(PyObject *self, PyObject *noargs)
    61176127{
    6118 #if defined(PYOS_OS2)
     6128#if defined(PYOS_OS2) && !defined(__KLIBC__)
    61196129    HFILE read, write;
    61206130    APIRET rc;
     
    63226332        if (rc != NO_ERROR)
    63236333            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
    63246342    } else {
    6325 #endif
     6343#endif /* OS2 */
    63266344
    63276345        /* XXX This can leak memory -- not easy to fix :-( */
     
    82678285    APIRET    rc;
    82688286    ULONG     values[QSV_MAX+1];
    8269     PyObject *v;
    82708287    char     *ver, tmp[50];
    82718288
     
    82968313    default:
    82978314        PyOS_snprintf(tmp, sizeof(tmp),
    8298                       "%d-%d", values[QSV_VERSION_MAJOR],
     8315                      "%ld-%ld", values[QSV_VERSION_MAJOR],
    82998316                      values[QSV_VERSION_MINOR]);
    83008317        ver = &tmp[0];
Note: See TracChangeset for help on using the changeset viewer.