Changeset 35 for trunk/src/kmk/compat.c


Ignore:
Timestamp:
Mar 18, 2003, 4:58:49 AM (22 years ago)
Author:
bird
Message:

emx is kind of working again...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/compat.c

    r27 r35  
    6666#include    <sys/wait.h>
    6767#endif
     68#if defined(__EMX__)
     69#include <sys/process.h>
     70#endif
     71#if defined(OS2) && defined(__IBMC__)
     72#include <process.h>
     73#endif
    6874#include    <ctype.h>
    6975#include    <errno.h>
     
    134140
    135141    }
     142    #if !(defined(OS2) && defined(__IBMC__))
    136143    if (signo == SIGQUIT)
    137144        exit(signo);
     145    #endif
    138146    (void) signal(signo, SIG_DFL);
    139147    (void) kill(getpid(), signo);
     
    228236
    229237    if (*cmdStart == '\0') {
    230         free(cmdStart);
     238        efree(cmdStart);
    231239        Error("%s expands to empty string", cmd);
    232240        return(0);
     
    329337     * Fork and execute the single command. If the fork fails, we abort.
    330338     */
     339#ifdef OS2 //@todo use klib later!
     340    cpid = _spawnvp(P_NOWAIT, av[0], av);
     341#else
    331342    cpid = vfork();
    332343    if (cpid < 0) {
     
    345356        exit(1);
    346357    }
     358#endif
    347359
    348360    /*
    349361     * we need to print out the command associated with this Gnode in
    350362     * Targ_PrintCmd from Targ_PrintGraph when debugging at level g2,
    351      * in main(), Fatal() and DieHorribly(), therefore do not free it
     363     * in main(), Fatal() and DieHorribly(), therefore do not efree it
    352364     * when debugging.
    353365     */
    354366    if (!DEBUG(GRAPH2)) {
    355         free(cmdStart);
     367        efree(cmdStart);
    356368        Lst_Replace (cmdNode, cmdp);
    357369    }
     
    664676        signal(SIGTERM, CompatInterrupt);
    665677    }
     678    #if !(defined(OS2) && defined(__IBMC__))
    666679    if (signal(SIGHUP, SIG_IGN) != SIG_IGN) {
    667680        signal(SIGHUP, CompatInterrupt);
    668681    }
     682    #endif
     683    #if !(defined(OS2) && defined(__IBMC__))
    669684    if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) {
    670685        signal(SIGQUIT, CompatInterrupt);
    671686    }
     687    #endif
    672688
    673689    for (cp = "#=|^(){};&<>*?[]:$`\\\n"; *cp != '\0'; cp++) {
Note: See TracChangeset for help on using the changeset viewer.