Changeset 3197 for trunk/src


Ignore:
Timestamp:
Mar 28, 2018, 6:11:30 PM (7 years ago)
Author:
bird
Message:

kmk/winchildren: Dont use fprintf for error handling, but fatal, output_write_text, and line buffered fwrite(stderr). Fixed incorrect SetThreadGroupAffinity calls (set affinity mask to 0 rather than max).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/w32/winchildren.c

    r3196 r3197  
    101101
    102102#include "nt/nt_child_inject_standard_handles.h"
     103#include "console.h"
    103104
    104105#ifndef KMK_BUILTIN_STANDALONE
     
    111112*********************************************************************************************************************************/
    112113#define MKWINCHILD_MAX_PATH     1024
     114
     115#define MKWINCHILD_DO_SET_PROCESSOR_GROUP
    113116
    114117/** Checks the UTF-16 environment variable pointed to is the PATH. */
     
    125128*   Structures and Typedefs                                                                                                      *
    126129*********************************************************************************************************************************/
     130/** Pointer to a childcare worker thread.   */
     131typedef struct WINCHILDCAREWORKER *PWINCHILDCAREWORKER;
     132/** Pointer to a windows child process. */
     133typedef struct WINCHILD *PWINCHILD;
     134
    127135/**
    128136 * Child process type.
     
    148156
    149157
    150 /** Pointer to a windows child process. */
    151 typedef struct WINCHILD *PWINCHILD;
    152158/**
    153159 * Windows child process.
     
    175181     * annoying source name output. */
    176182    BOOL                    fProbableClExe;
     183    /** The worker executing this child. */
     184    PWINCHILDCAREWORKER     pWorker;
    177185
    178186    /** Type specific data. */
     
    334342    long volatile           fIdle;
    335343} WINCHILDCAREWORKER;
    336 /** Pointer to a childcare worker thread.   */
    337 typedef WINCHILDCAREWORKER *PWINCHILDCAREWORKER;
    338344/** WINCHILD::uMagic value. */
    339345#define WINCHILDCAREWORKER_MAGIC    0xdad0dad0U
     
    616622
    617623/**
     624 * Output error message while running on a worker thread.
     625 *
     626 * @returns -1
     627 * @param   pWorker             The calling worker.  Mainly for getting the
     628 *                              current child and its stderr output unit.  Pass
     629 *                              NULL if the output should go thru the child
     630 *                              stderr buffering.
     631 * @param   iType               The error type:
     632 *                                  - 0: more of a info directly to stdout,
     633 *                                  - 1: child related error,
     634 *                                  - 2: child related error for immedate release.
     635 * @param   pszFormat           The message format string.
     636 * @param   ...                 Argument for the message.
     637 */
     638static int MkWinChildError(PWINCHILDCAREWORKER pWorker, int iType, const char *pszFormat, ...)
     639{
     640    /*
     641     * Format the message into stack buffer.
     642     */
     643    char        szMsg[4096];
     644    int         cchMsg;
     645    int         cchPrefix;
     646    va_list     va;
     647
     648    /* Compose the prefix, being paranoid about it not exceeding the buffer in any way. */
     649    const char *pszInfix = iType == 0 ? "info: " : "error: ";
     650    const char *pszProgram = program;
     651    if (strlen(pszProgram) > 80)
     652    {
     653#ifdef KMK
     654        pszProgram = "kmk";
     655#else
     656        pszProgram = "gnumake";
     657#endif
     658    }
     659    if (makelevel == 0)
     660        cchPrefix = snprintf(szMsg, sizeof(szMsg) / 2, "%s: %s", pszProgram, pszInfix);
     661    else
     662        cchPrefix = snprintf(szMsg, sizeof(szMsg) / 2, "%s[%u]: %s", pszProgram, makelevel, pszInfix);
     663    assert(cchPrefix < sizeof(szMsg) / 2 && cchPrefix > 0);
     664
     665    /* Format the user specified message. */
     666    va_start(va, pszFormat);
     667    cchMsg = vsnprintf(&szMsg[cchPrefix], sizeof(szMsg) - 2 - cchPrefix, pszFormat, va);
     668    va_end(va);
     669    szMsg[sizeof(szMsg) - 2] = '\0';
     670    cchMsg = strlen(szMsg);
     671
     672    /* Make sure there's a newline at the end of it (we reserved space for that). */
     673    if (cchMsg <= 0 || szMsg[cchMsg - 1] != '\n')
     674    {
     675        szMsg[cchMsg++] = '\n';
     676        szMsg[cchMsg]   = '\0';
     677    }
     678
     679#ifdef CONFIG_WITH_OUTPUT_IN_MEMORY
     680    /*
     681     * Try use the stderr of the current child of the worker.
     682     */
     683    if (   iType != 0
     684        && iType != 3
     685        && pWorker)
     686    {
     687        PWINCHILD pChild = pWorker->pCurChild;
     688        if (pChild)
     689        {
     690            struct child *pMkChild = pChild->pMkChild;
     691            if (pMkChild)
     692            {
     693                output_write_text(&pMkChild->output, 1 /*is_err*/, szMsg, cchMsg);
     694                return -1;
     695            }
     696        }
     697    }
     698#endif
     699
     700    /*
     701     * Fallback to writing directly to stderr.
     702     */
     703    maybe_con_fwrite(szMsg, cchMsg, 1, iType == 0 ? stdout : stderr);
     704    return -1;
     705}
     706
     707/**
    618708 * Duplicates the given UTF-16 string.
    619709 *
     
    816906        else
    817907        {
    818             fprintf(stderr, "warning: GetOverlappedResult failed: %u\n", GetLastError());
     908            MkWinChildError(pChild->pWorker, 2, "GetOverlappedResult failed: %u\n", GetLastError());
    819909            pPipe->fReadPending = FALSE;
    820910            if (fDraining)
     
    844934                pPipe->fReadPending = TRUE;
    845935            else
    846                 fprintf(stderr, "warning: ReadFile failed on standard %s: %u\n",
    847                         pPipe->iWhich == 1 ? "output" : "error",  GetLastError());
     936                MkWinChildError(pChild->pWorker, 2, "ReadFile failed on standard %s: %u\n",
     937                                pPipe->iWhich == 1 ? "output" : "error",  GetLastError());
    848938            return;
    849939        }
     
    9561046                        || !pChild->pMkChild->file
    9571047                        || !pChild->pMkChild->file->name)
    958                         printf("Pid %u ('%s') still running after %u seconds\n",
    959                                GetProcessId(hProcess), pwszJob, (msNow - msStart) / 1000);
     1048                        MkWinChildError(NULL, 0, "Pid %u ('%s') still running after %u seconds\n",
     1049                                        GetProcessId(hProcess), pwszJob, (msNow - msStart) / 1000);
    9601050                    else
    961                         printf("Target '%s' (pid %u) still running after %u seconds\n",
    962                                pChild->pMkChild->file->name, GetProcessId(hProcess), (msNow - msStart) / 1000);
     1051                        MkWinChildError(NULL, 0, "Target '%s' (pid %u) still running after %u seconds\n",
     1052                                        pChild->pMkChild->file->name, GetProcessId(hProcess), (msNow - msStart) / 1000);
    9631053                }
    9641054
     
    10941184    else
    10951185    {
    1096         fprintf(stderr, "CreateProcess(%ls) failed: %u\n", pwszImageName, dwErr);
     1186        MkWinChildError(pWorker, 1, "CreateProcess(%ls) failed: %u\n", pwszImageName, dwErr);
    10971187        return (int)dwErr;
    10981188    }
     
    11251215            dwErr = nt_child_inject_standard_handles(ProcInfo.hProcess, pafReplace, pahChild, szErrMsg, sizeof(szErrMsg));
    11261216            if (dwErr != 0)
    1127                 fprintf(stderr, "%s\n", szErrMsg);
     1217                MkWinChildError(pWorker, 1, "%s\n", szErrMsg);
    11281218        }
    11291219
     
    11311221         * Assign processor group (ignore failure).
    11321222         */
     1223#ifdef MKWINCHILD_DO_SET_PROCESSOR_GROUP
    11331224        if (g_cProcessorGroups > 1)
    11341225        {
    1135             GROUP_AFFINITY Affinity = { ~(ULONG_PTR)0, pWorker->iProcessorGroup, { 0, 0, 0 } };
     1226            GROUP_AFFINITY Affinity = { 0, pWorker->iProcessorGroup, { 0, 0, 0 } };
    11361227            fRet = g_pfnSetThreadGroupAffinity(ProcInfo.hThread, &Affinity, NULL);
    11371228            assert(fRet);
    11381229        }
     1230#endif
    11391231
    11401232#ifdef KMK
     
    11641256            {
    11651257                dwErr = GetLastError();
    1166                 fprintf(stderr, "ResumeThread failed on child process: %u\n", dwErr);
     1258                MkWinChildError(pWorker, 1, "ResumeThread failed on child process: %u\n", dwErr);
    11671259            }
    11681260        }
     
    11851277 *
    11861278 * @returns 0 on success, non-zero on failure.
     1279 * @param   pWorker             The childcare worker.
    11871280 * @param   papszArgs           The argument vector to convert.
    11881281 * @param   ppwszCommandLine    Where to return the command line.
    11891282 */
    1190 static int mkWinChildcareWorkerConvertQuotedArgvToCommandline(char **papszArgs, WCHAR **ppwszCommandLine)
     1283static int mkWinChildcareWorkerConvertQuotedArgvToCommandline(PWINCHILDCAREWORKER pWorker, char **papszArgs,
     1284                                                              WCHAR **ppwszCommandLine)
    11911285{
    11921286    WCHAR   *pwszCmdLine;
     
    12071301        {
    12081302            DWORD dwErr = GetLastError();
    1209             fprintf(stderr, _("MultiByteToWideChar failed to convert argv[%u] (%s): %u\n"), i, pszSrc, dwErr);
     1303            MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert argv[%u] (%s): %u\n"), i, pszSrc, dwErr);
    12101304            return dwErr;
    12111305        }
     
    12311325        {
    12321326            DWORD dwErr = GetLastError();
    1233             fprintf(stderr, _("MultiByteToWideChar failed to convert argv[%u] (%s): %u\n"), i, pszSrc, dwErr);
     1327            MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert argv[%u] (%s): %u\n"), i, pszSrc, dwErr);
    12341328            free(pwszCmdLine);
    12351329            return dwErr;
     
    12531347#define MKWCCWCMD_F_HAVE_KASH_C     8 /**< kmk_ash -c "..." */
    12541348
    1255 static int mkWinChildcareWorkerConvertCommandline(char **papszArgs, unsigned fFlags, WCHAR **ppwszCommandLine)
     1349/*
     1350 * @param   pWorker         The childcare worker if on one, otherwise NULL.
     1351 */
     1352static int mkWinChildcareWorkerConvertCommandline(PWINCHILDCAREWORKER pWorker, char **papszArgs, unsigned fFlags,
     1353                                                  WCHAR **ppwszCommandLine)
    12561354{
    12571355    struct ARGINFO
     
    13101408            {
    13111409                DWORD dwErr = GetLastError();
    1312                 fprintf(stderr, _("MultiByteToWideChar failed to convert argv[%u] (%s): %u\n"), i, pszSrc, dwErr);
     1410                MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert argv[%u] (%s): %u\n"), i, pszSrc, dwErr);
    13131411                return dwErr;
    13141412            }
     
    14791577}
    14801578
    1481 static int mkWinChildcareWorkerConvertCommandlineWithShell(const WCHAR *pwszShell, char **papszArgs, WCHAR **ppwszCommandLine)
    1482 {
    1483     fprintf(stderr, "%s: not found!\n", papszArgs[0]);
     1579static int mkWinChildcareWorkerConvertCommandlineWithShell(PWINCHILDCAREWORKER pWorker, const WCHAR *pwszShell, char **papszArgs,
     1580                                                           WCHAR **ppwszCommandLine)
     1581{
     1582    MkWinChildError(pWorker, 1, "%s: not found!\n", papszArgs[0]);
    14841583//__debugbreak();
    14851584    return ERROR_FILE_NOT_FOUND;
     
    15731672 *
    15741673 * @returns 0 on success, windows error code on failure.
     1674 * @param   pWorker         The childcare worker.
    15751675 * @param   pszArg0         The first argument.
    15761676 * @param   pwszSearchPath  In case mkWinChildcareWorkerConvertEnvironment
     
    15841684 * @param   pfProbableClExe Where to return an indicator of probably CL.EXE.
    15851685 */
    1586 static int mkWinChildcareWorkerFindImage(char const *pszArg0, WCHAR *pwszSearchPath, WCHAR const *pwszzEnv,
    1587                                          const char *pszShell, WCHAR **ppwszImagePath, BOOL *pfNeedShell, BOOL *pfProbableClExe)
     1686static int mkWinChildcareWorkerFindImage(PWINCHILDCAREWORKER pWorker, char const *pszArg0, WCHAR *pwszSearchPath,
     1687                                         WCHAR const *pwszzEnv, const char *pszShell,
     1688                                         WCHAR **ppwszImagePath, BOOL *pfNeedShell, BOOL *pfProbableClExe)
    15881689{
    15891690    /** @todo Slap a cache on this code. We usually end up executing the same
     
    18811982                return mkWinChildDuplicateUtf16String(wszPathBuf, cwc, ppwszImagePath);
    18821983            dwErr = GetLastError();
    1883             fprintf(stderr, _("MultiByteToWideChar failed to convert shell (%s): %u\n"), pszShell, dwErr);
     1984            MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert shell (%s): %u\n"), pszShell, dwErr);
    18841985        }
    18851986        else
    18861987        {
    1887             fprintf(stderr, "%s: not found!\n", pszArg0);
     1988            MkWinChildError(pWorker, 1, "%s: not found!\n", pszArg0);
    18881989            dwErr = ERROR_FILE_NOT_FOUND;
    18891990        }
     
    18921993    {
    18931994        dwErr = GetLastError();
    1894         fprintf(stderr, _("MultiByteToWideChar failed to convert argv[0] (%s): %u\n"), pszArg0, dwErr);
     1995        MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert argv[0] (%s): %u\n"), pszArg0, dwErr);
    18951996    }
    18961997    return dwErr == ERROR_INSUFFICIENT_BUFFER ? ERROR_FILENAME_EXCED_RANGE : dwErr;
     
    19012002 *
    19022003 * @returns 0 on success, windows error code on failure.
     2004 * @param   pWorker         The childcare worker if on one, otherwise NULL.
    19032005 * @param   papszEnv        The environment vector to convert.
    19042006 * @param   cbEnvStrings    The size of the environment strings, iff they are
     
    19112013 *                          mkWinChildcareWorkerFindImage() search when needed.
    19122014 */
    1913 static int mkWinChildcareWorkerConvertEnvironment(char **papszEnv, size_t cbEnvStrings,
     2015static int mkWinChildcareWorkerConvertEnvironment(PWINCHILDCAREWORKER pWorker, char **papszEnv, size_t cbEnvStrings,
    19142016                                                  WCHAR **ppwszEnv, WCHAR const **ppwszSearchPath)
    19152017{
     
    19532055            dwErr = GetLastError();
    19542056        }
    1955         fprintf(stderr, _("MultiByteToWideChar failed to convert environment block: %u\n"), dwErr);
     2057        MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert environment block: %u\n"), dwErr);
    19562058    }
    19572059    /*
     
    20312133                if (cwcRc <= 0)
    20322134                {
    2033                     fprintf(stderr, _("MultiByteToWideChar failed to convert environment string #%u (%s): %u\n"),
    2034                             iVar, pszSrc, dwErr);
     2135                    MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert environment string #%u (%s): %u\n"),
     2136                                    iVar, pszSrc, dwErr);
    20352137                    free(pwszzDst);
    20362138                    return dwErr;
     
    20772179     * search for the executable.
    20782180     */
    2079     rc = mkWinChildcareWorkerConvertEnvironment(pChild->u.Process.papszEnv ? pChild->u.Process.papszEnv : environ,
     2181    rc = mkWinChildcareWorkerConvertEnvironment(pWorker, pChild->u.Process.papszEnv ? pChild->u.Process.papszEnv : environ,
    20802182                                                pChild->u.Process.cbEnvStrings,
    20812183                                                &pwszzEnvironment, &pwszSearchPath);
     
    20852187     */
    20862188    if (rc == 0)
    2087         rc = mkWinChildcareWorkerFindImage(pChild->u.Process.papszArgs[0], pwszSearchPath, pwszzEnvironment,
     2189        rc = mkWinChildcareWorkerFindImage(pWorker, pChild->u.Process.papszArgs[0], pwszSearchPath, pwszzEnvironment,
    20882190                                           pChild->u.Process.pszShell, &pwszImageName, &fNeedShell, &pChild->fProbableClExe);
    20892191    if (rc == 0)
    20902192    {
    20912193        if (!fNeedShell)
    2092             rc = mkWinChildcareWorkerConvertCommandline(pChild->u.Process.papszArgs, 0 /*fFlags*/, &pwszCommandLine);
     2194            rc = mkWinChildcareWorkerConvertCommandline(pWorker, pChild->u.Process.papszArgs, 0 /*fFlags*/, &pwszCommandLine);
    20932195        else
    2094             rc = mkWinChildcareWorkerConvertCommandlineWithShell(pwszImageName, pChild->u.Process.papszArgs, &pwszCommandLine);
     2196            rc = mkWinChildcareWorkerConvertCommandlineWithShell(pWorker, pwszImageName, pChild->u.Process.papszArgs,
     2197                                                                 &pwszCommandLine);
    20952198
    20962199        /*
     
    21842287                return;
    21852288            }
    2186             fprintf(stderr, "kmk_builtin_append: close failed on '%s': %u (%s)\n",
    2187                     pChild->u.Append.pszFilename, errno, strerror(errno));
     2289            MkWinChildError(pWorker, 1, "kmk_builtin_append: close failed on '%s': %u (%s)\n",
     2290                            pChild->u.Append.pszFilename, errno, strerror(errno));
    21882291        }
    21892292        else
    2190             fprintf(stderr, "kmk_builtin_append: error writing %lu bytes to on '%s': %u (%s)\n",
    2191                     pChild->u.Append.cbAppend, pChild->u.Append.pszFilename, errno, strerror(errno));
     2293            MkWinChildError(pWorker, 1, "kmk_builtin_append: error writing %lu bytes to on '%s': %u (%s)\n",
     2294                            pChild->u.Append.cbAppend, pChild->u.Append.pszFilename, errno, strerror(errno));
    21922295        close(fd);
    21932296    }
    21942297    else
    2195         fprintf(stderr, "kmk_builtin_append: error opening '%s': %u (%s)\n",
    2196                 pChild->u.Append.pszFilename, errno, strerror(errno));
     2298        MkWinChildError(pWorker, 1, "kmk_builtin_append: error opening '%s': %u (%s)\n",
     2299                        pChild->u.Append.pszFilename, errno, strerror(errno));
    21972300    pChild->iExitCode = 1;
    21982301}
     
    22512354    assert(pWorker->uMagic == WINCHILDCAREWORKER_MAGIC);
    22522355
     2356#ifdef MKWINCHILD_DO_SET_PROCESSOR_GROUP
    22532357    /*
    22542358     * Adjust process group if necessary.
     2359     *
     2360     * Note! It seems that setting the mask to zero means that we select all
     2361     *       active processors.  Couldn't find any alternative API for getting
     2362     *       the correct active processor mask.
    22552363     */
    22562364    if (g_cProcessorGroups > 1)
    22572365    {
    2258         GROUP_AFFINITY Affinity = { ~(ULONG_PTR)0, pWorker->iProcessorGroup, { 0, 0, 0 } };
     2366        GROUP_AFFINITY Affinity = { 0 /* == all active apparently */ , pWorker->iProcessorGroup, { 0, 0, 0 } };
    22592367        BOOL fRet = g_pfnSetThreadGroupAffinity(GetCurrentThread(), &Affinity, NULL);
    22602368        assert(fRet); (void)fRet;
    2261     }
     2369# ifndef NDEBUG
     2370        {
     2371            GROUP_AFFINITY ActualAffinity = { 0xbeefbeefU, 0xbeef, { 0xbeef, 0xbeef, 0xbeef } };
     2372            fRet = GetThreadGroupAffinity(GetCurrentThread(), &ActualAffinity);
     2373            assert(fRet); (void)fRet;
     2374            assert(ActualAffinity.Group == pWorker->iProcessorGroup);
     2375        }
     2376# endif
     2377    }
     2378#endif
    22622379
    22632380    /*
     
    23042421                PWINCHILD pTailExpect;
    23052422
     2423                pChild->pWorker = pWorker;
    23062424                pWorker->pCurChild = pChild;
    23072425                switch (pChild->enmType)
     
    23282446                }
    23292447                pWorker->pCurChild = NULL;
     2448                pChild->pWorker = NULL;
    23302449
    23312450                /*
     
    23472466                        if (SetEvent(g_hEvtWaitChildren))
    23482467                            break;
    2349                         fprintf(stderr, "SetEvent(g_hEvtWaitChildren=%p) failed: %u\n", g_hEvtWaitChildren, GetLastError());
     2468                        MkWinChildError(pWorker, 1, "SetEvent(g_hEvtWaitChildren=%p) failed: %u\n",
     2469                                        g_hEvtWaitChildren, GetLastError());
    23502470                        break;
    23512471                    }
     
    25242644
    25252645                /* Bail out! */
    2526                 fprintf(stderr, "warning! _beginthreadex failed: %u (%s)\n", errno, strerror(errno));
     2646                ONS (error, NILF, "_beginthreadex failed: %u (%s)\n", errno, strerror(errno));
    25272647                mkWinChildcareDeleteWorkerPipe(&pWorker->StdErr);
    25282648            }
    25292649            else
    2530                 fprintf(stderr, "warning! Failed to create stderr pipe: %u\n", GetLastError());
     2650                ON (error, NILF, "Failed to create stderr pipe: %u\n", GetLastError());
    25312651            mkWinChildcareDeleteWorkerPipe(&pWorker->StdOut);
    25322652        }
    25332653        else
    2534             fprintf(stderr, "warning! Failed to create stdout pipe: %u\n", GetLastError());
     2654            ON (error, NILF, "Failed to create stdout pipe: %u\n", GetLastError());
    25352655        CloseHandle(pWorker->hEvtIdle);
    25362656    }
    25372657    else
    2538         fprintf(stderr, "warning! CreateEvent failed: %u\n", GetLastError());
     2658        ON (error, NILF, "CreateEvent failed: %u\n", GetLastError());
    25392659    pWorker->uMagic = ~WINCHILDCAREWORKER_MAGIC;
    25402660    free(pWorker);
     
    30613181        {
    30623182            rc = GetLastError();
    3063             fprintf(stderr, _("MultiByteToWideChar failed to convert CWD (%s): %u\n"), pszCwd, (unsigned)rc);
     3183            MkWinChildError(pWorker, 1, _("MultiByteToWideChar failed to convert CWD (%s): %u\n"), pszCwd, (unsigned)rc);
    30643184            return rc;
    30653185        }
     
    30703190     * have to traverse it twice to find the PATH.
    30713191     */
    3072     rc = mkWinChildcareWorkerConvertEnvironment(papszEnvVars ? papszEnvVars : environ, 0/*cbEnvStrings*/,
     3192    rc = mkWinChildcareWorkerConvertEnvironment(pWorker, papszEnvVars ? papszEnvVars : environ, 0/*cbEnvStrings*/,
    30733193                                                &pwszzEnvironment, &pwszSearchPath);
    30743194    /*
     
    30773197     */
    30783198    if (rc == 0)
    3079         rc = mkWinChildcareWorkerFindImage(pszExecutable, pwszSearchPath, pwszzEnvironment, NULL /*pszShell*/,
     3199        rc = mkWinChildcareWorkerFindImage(pWorker, pszExecutable, pwszSearchPath, pwszzEnvironment, NULL /*pszShell*/,
    30803200                                           &pwszImageName, &fNeedShell, &pChild->fProbableClExe);
    30813201    if (rc == 0)
     
    30833203        assert(!fNeedShell);
    30843204        if (!fQuotedArgv)
    3085             rc = mkWinChildcareWorkerConvertCommandline(papszArgs, 0 /*fFlags*/, &pwszCommandLine);
     3205            rc = mkWinChildcareWorkerConvertCommandline(pWorker, papszArgs, 0 /*fFlags*/, &pwszCommandLine);
    30863206        else
    3087             rc = mkWinChildcareWorkerConvertQuotedArgvToCommandline(papszArgs, &pwszCommandLine);
     3207            rc = mkWinChildcareWorkerConvertQuotedArgvToCommandline(pWorker, papszArgs, &pwszCommandLine);
    30883208
    30893209        /*
     
    32813401     * Create the command line and environment.
    32823402     */
    3283     rc = mkWinChildcareWorkerConvertCommandline(papszArgs, 0 /*fFlags*/, &pwszCommandLine);
     3403    rc = mkWinChildcareWorkerConvertCommandline(NULL, papszArgs, 0 /*fFlags*/, &pwszCommandLine);
    32843404    if (rc != 0)
    32853405        ON(fatal, NILF, _("MkWinChildReExecMake: mkWinChildcareWorkerConvertCommandline failed: %u\n"), rc);
    32863406
    3287     rc = mkWinChildcareWorkerConvertEnvironment(papszEnv ? papszEnv : environ, 0 /*cbEnvStrings*/,
     3407    rc = mkWinChildcareWorkerConvertEnvironment(NULL, papszEnv ? papszEnv : environ, 0 /*cbEnvStrings*/,
    32883408                                                &pwszzEnvironment, &pwszPathIgnored);
    32893409    if (rc != 0)
Note: See TracChangeset for help on using the changeset viewer.