Mercurial > hg > xemacs-beta
comparison src/sysdep.c @ 179:9ad43877534d r20-3b16
Import from CVS: tag r20-3b16
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:52:19 +0200 |
parents | 2d532a89d707 |
children | 3d6bfa290dbd |
comparison
equal
deleted
inserted
replaced
178:e703507b8a00 | 179:9ad43877534d |
---|---|
63 #include "systime.h" | 63 #include "systime.h" |
64 #if defined(WINDOWSNT) | 64 #if defined(WINDOWSNT) |
65 #include "syssignal.h" | 65 #include "syssignal.h" |
66 #else | 66 #else |
67 #include <sys/times.h> | 67 #include <sys/times.h> |
68 #endif | |
69 | |
70 #ifdef WINDOWSNT | |
71 #include <direct.h> | |
72 /* In process.h which conflicts with the local copy. */ | |
73 #define _P_WAIT 0 | |
74 int _CRTAPI1 _spawnlp (int, const char *, const char *, ...); | |
75 int _CRTAPI1 _getpid (void); | |
68 #endif | 76 #endif |
69 | 77 |
70 /* ------------------------------- */ | 78 /* ------------------------------- */ |
71 /* VMS includes */ | 79 /* VMS includes */ |
72 /* ------------------------------- */ | 80 /* ------------------------------- */ |
602 /* #### Unix specific */ | 610 /* #### Unix specific */ |
603 if (str[len - 1] != '/') str[len++] = '/'; | 611 if (str[len - 1] != '/') str[len++] = '/'; |
604 str[len] = 0; | 612 str[len] = 0; |
605 xyzzy: | 613 xyzzy: |
606 | 614 |
615 #ifdef WINDOWSNT | |
616 pid = -1; | |
617 #else /* not WINDOWSNT */ | |
618 | |
607 pid = vfork (); | 619 pid = vfork (); |
608 | 620 |
609 if (pid == -1) | 621 if (pid == -1) |
610 error ("Can't spawn subshell"); | 622 error ("Can't spawn subshell"); |
611 if (pid == 0) | 623 if (pid == 0) |
624 | |
625 #endif /* not WINDOWSNT */ | |
612 { | 626 { |
613 char *sh = 0; | 627 char *sh = 0; |
614 | 628 |
615 #ifdef MSDOS /* MW, Aug 1993 */ | 629 #ifdef MSDOS /* MW, Aug 1993 */ |
616 getwd (oldwd); | 630 getwd (oldwd); |
642 if (st) | 656 if (st) |
643 report_file_error ("Can't execute subshell", | 657 report_file_error ("Can't execute subshell", |
644 Fcons (build_string (sh), Qnil)); | 658 Fcons (build_string (sh), Qnil)); |
645 #endif | 659 #endif |
646 #else /* not MSDOS */ | 660 #else /* not MSDOS */ |
661 #ifdef WINDOWSNT | |
662 /* Waits for process completion */ | |
663 pid = _spawnlp (_P_WAIT, sh, sh, NULL); | |
664 if (pid == -1) | |
665 write (1, "Can't execute subshell", 22); | |
666 | |
667 #if 0 | |
668 /* This relates to the GNU Emacs console port, not required under X ? */ | |
669 take_console (); | |
670 #endif | |
671 #else /* not WINDOWSNT */ | |
647 execlp (sh, sh, 0); | 672 execlp (sh, sh, 0); |
648 write (1, "Can't execute subshell", 22); | 673 write (1, "Can't execute subshell", 22); |
649 _exit (1); | 674 _exit (1); |
675 #endif /* not WINDOWSNT */ | |
650 #endif /* not MSDOS */ | 676 #endif /* not MSDOS */ |
651 } | 677 } |
652 | 678 |
653 save_signal_handlers (saved_handlers); | 679 save_signal_handlers (saved_handlers); |
654 synch_process_alive = 1; | 680 synch_process_alive = 1; |
2638 new_action.sa_flags = SA_INTERRUPT; | 2664 new_action.sa_flags = SA_INTERRUPT; |
2639 #else | 2665 #else |
2640 new_action.sa_flags = 0; | 2666 new_action.sa_flags = 0; |
2641 #endif | 2667 #endif |
2642 sigaction (signal_number, &new_action, &old_action); | 2668 sigaction (signal_number, &new_action, &old_action); |
2643 return (old_action.sa_handler); | 2669 return (signal_handler_t) (old_action.sa_handler); |
2644 | 2670 |
2645 #endif /* not 0 */ | 2671 #endif /* not 0 */ |
2646 } | 2672 } |
2647 | 2673 |
2648 #elif defined (HAVE_SIGBLOCK) | 2674 #elif defined (HAVE_SIGBLOCK) |