Changeset 3156 for trunk/src/kmk/job.c
- Timestamp:
- Mar 18, 2018, 9:10:03 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/job.c
r3141 r3156 117 117 # include <io.h> 118 118 # include <process.h> 119 # include "sub_proc.h" 119 # ifdef CONFIG_NEW_WIN_CHILDREN 120 # include "w32/winchildren.h" 121 # else 122 # include "sub_proc.h" 123 # endif 120 124 # include "w32err.h" 121 125 # include "pathstuff.h" … … 262 266 263 267 #ifdef WINDOWS32 268 # ifndef CONFIG_NEW_WIN_CHILDREN /* (only used by commands.c) */ 264 269 /* 265 270 * The macro which references this function is defined in makeint.h. … … 270 275 return ((process_kill ((HANDLE)pid, sig) == TRUE) ? 0 : -1); 271 276 } 277 # endif /* !CONFIG_NEW_WIN_CHILDREN */ 272 278 273 279 /* This function creates a temporary file name with an extension specified … … 807 813 #endif /* _AMIGA */ 808 814 #ifdef WINDOWS32 815 # ifndef CONFIG_NEW_WIN_CHILDREN 809 816 { 810 817 HANDLE hPID; … … 869 876 pid = (pid_t) hPID; 870 877 } 878 # else /* CONFIG_NEW_WIN_CHILDREN */ 879 assert (!any_remote); 880 pid = 0; 881 coredump = exit_sig = exit_code = 0; 882 { 883 int rc = MkWinChildWait(block, &pid, &exit_code, &exit_sig, &coredump, &c); 884 if (rc != 0) 885 ON (fatal, NILF, _("MkWinChildWait: %u"), rc); 886 } 887 if (pid == 0) 888 { 889 /* No more children, stop. */ 890 reap_more = 0; 891 break; 892 } 893 894 /* If we have started jobs in this second, remove one. */ 895 if (job_counter) 896 --job_counter; 897 # endif /* CONFIG_NEW_WIN_CHILDREN */ 871 898 #endif /* WINDOWS32 */ 872 899 } … … 1656 1683 #ifdef WINDOWS32 1657 1684 { 1685 # ifndef CONFIG_NEW_WIN_CHILDREN 1658 1686 HANDLE hPID; 1659 1687 char* arg0; … … 1699 1727 goto error; 1700 1728 } 1729 # else /* CONFIG_NEW_WIN_CHILDREN */ 1730 struct variable *shell_var = lookup_variable("SHELL", 5); 1731 const char *shell_value = !shell_var ? NULL 1732 : !shell_var->recursive || strchr(shell_var->value, '$') == NULL 1733 ? shell_var->value : variable_expand (shell_var->value); 1734 int rc = MkWinChildCreate(argv, child->environment, shell_value, child, &child->pid); 1735 if (rc != 0) 1736 { 1737 int i; 1738 unblock_sigs (); 1739 fprintf (stderr, _("failed to launch process (rc=%d)\n"), rc); 1740 for (i = 0; argv[i]; i++) 1741 fprintf (stderr, "%s ", argv[i]); 1742 fprintf (stderr, "\n", argv[i]); 1743 goto error; 1744 } 1745 #endif /* CONFIG_NEW_WIN_CHILDREN */ 1701 1746 } 1702 1747 #endif /* WINDOWS32 */ … … 1771 1816 #endif 1772 1817 #ifdef WINDOWS32 1818 # ifndef CONFIG_NEW_WIN_CHILDREN 1773 1819 || (process_used_slots () >= MAXIMUM_WAIT_OBJECTS) 1820 # endif 1774 1821 #endif 1775 1822 )) … … 2193 2240 time_t now; 2194 2241 2195 #if def WINDOWS322242 #if defined(WINDOWS32) && !defined(CONFIG_NEW_WIN_CHILDREN) 2196 2243 /* sub_proc.c cannot wait for more than MAXIMUM_WAIT_OBJECTS children */ 2197 2244 if (process_used_slots () >= MAXIMUM_WAIT_OBJECTS) … … 2436 2483 2437 2484 2485 #if !defined(WINDOWS32) || !defined(CONFIG_NEW_WIN_CHILDREN) 2438 2486 #ifndef _AMIGA 2439 2487 /* Replace the current process with one running the command in ARGV, … … 2459 2507 #else 2460 2508 #ifdef WINDOWS32 2509 # ifndef CONFIG_NEW_WIN_CHILDREN 2461 2510 HANDLE hPID; 2462 2511 HANDLE hWaitPID; … … 2514 2563 /* return child's exit code as our exit code */ 2515 2564 exit (exit_code); 2516 2565 # else /* CONFIG_NEW_WIN_CHILDREN */ 2566 2567 # endif /* CONFIG_NEW_WIN_CHILDREN */ 2517 2568 #else /* !WINDOWS32 */ 2518 2569 … … 2648 2699 2649 2700 #endif /* On Amiga */ 2701 #endif /* !defined(WINDOWS32) || !defined(CONFIG_NEW_WIN_CHILDREN) */ 2650 2702 2651 2703 … … 2777 2829 2778 2830 const char *sh_chars; 2779 c onst char **sh_cmds;2831 char const * const * sh_cmds; /* kmk: +_sh +const*2 */ 2780 2832 #elif defined(__riscos__) 2781 2833 static const char *sh_chars = ""; … … 3330 3382 /* This is the start of a new recipe line. Skip whitespace 3331 3383 and prefix characters but not newlines. */ 3384 #ifndef CONFIG_WITH_COMMANDS_FUNC 3332 3385 while (ISBLANK (*f) || *f == '-' || *f == '@' || *f == '+') 3386 #else 3387 char ch; 3388 while (ISBLANK ((ch = *f)) || ch == '-' || ch == '@' || ch == '+' || ch == '%') 3389 #endif 3333 3390 ++f; 3334 3391 … … 3382 3439 /* This is the start of a new recipe line. Skip whitespace 3383 3440 and prefix characters but not newlines. */ 3441 #ifndef CONFIG_WITH_COMMANDS_FUNC 3384 3442 while (ISBLANK (*f) || *f == '-' || *f == '@' || *f == '+') 3443 #else 3444 char ch; 3445 while (ISBLANK ((ch = *f)) || ch == '-' || ch == '@' || ch == '+' || ch == '%') 3446 #endif 3385 3447 ++f; 3386 3448
Note:
See TracChangeset
for help on using the changeset viewer.