Ignore:
Timestamp:
Sep 9, 2020, 10:01:39 PM (5 years ago)
Author:
bird
Message:

kash: Hammering on threaded mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/bltin/kill.c

    r3409 r3438  
    6161killcmd(shinstance *psh, int argc, char *argv[])
    6262{
    63         int errors, numsig, pid;
     63        int errors, numsig;
    6464        char *ep;
    6565
     
    131131
    132132        for (errors = 0; argc; argc--, argv++) {
    133                 if (*argv[0] == '%') {
    134                         pid = getjobpgrp(psh, *argv);
     133                const char * const strpid = argv[0];
     134                shpid pid;
     135                if (*strpid == '%') {
     136                        pid = getjobpgrp(psh, strpid);
    135137                        if (pid == 0) {
    136                                 sh_warnx(psh, "illegal job id: %s", *argv);
     138                                sh_warnx(psh, "illegal job id: %s", strpid);
    137139                                errors = 1;
    138140                                continue;
    139141                        }
    140142                } else {
    141                         pid = strtol(*argv, &ep, 10);
    142                         if (!**argv || *ep) {
    143                                 sh_warnx(psh, "illegal process id: %s", *argv);
     143#if !defined(SH_FORKED_MODE) && defined(_MSC_VER)
     144                        pid = _strtoi64(strpid, &ep, 10);
     145#elif !defined(SH_FORKED_MODE)
     146                        pid = strtoll(strpid, &ep, 10);
     147#else
     148                        pid = strtol(strpid, &ep, 10);
     149#endif
     150                        if (!*strpid || *ep) {
     151                                sh_warnx(psh, "illegal process id: %s", strpid);
    144152                                errors = 1;
    145153                                continue;
     
    147155                }
    148156                if (sh_kill(psh, pid, numsig) == -1) {
    149                         sh_warn(psh, "%s", *argv);
     157                        sh_warn(psh, "%s", strpid);
    150158                        errors = 1;
    151159                }
Note: See TracChangeset for help on using the changeset viewer.