comparison src/process-nt.c @ 432:3a7e78e1142d r21-2-24

Import from CVS: tag r21-2-24
author cvs
date Mon, 13 Aug 2007 11:29:58 +0200
parents a5df635868b2
children 080151679be2
comparison
equal deleted inserted replaced
431:a97165e56215 432:3a7e78e1142d
656 { 656 {
657 NT_DATA(p)->need_enable_child_signals = 10; 657 NT_DATA(p)->need_enable_child_signals = 10;
658 kick_status_notify (); 658 kick_status_notify ();
659 } 659 }
660 660
661 /* Hack to support Windows 95 negative pids */ 661 return ((int)pi.dwProcessId);
662 return ((int)pi.dwProcessId < 0
663 ? -(int)pi.dwProcessId : (int)pi.dwProcessId);
664 } 662 }
665 } 663 }
666 664
667 /* 665 /*
668 * This method is called to update status fields of the process 666 * This method is called to update status fields of the process
717 unix_send_process... */ 715 unix_send_process... */
718 716
719 static void 717 static void
720 nt_send_process (Lisp_Object proc, struct lstream* lstream) 718 nt_send_process (Lisp_Object proc, struct lstream* lstream)
721 { 719 {
722 struct Lisp_Process *p = XPROCESS (proc); 720 volatile Lisp_Object vol_proc = proc;
721 struct Lisp_Process *volatile p = XPROCESS (proc);
723 722
724 /* use a reasonable-sized buffer (somewhere around the size of the 723 /* use a reasonable-sized buffer (somewhere around the size of the
725 stream buffer) so as to avoid inundating the stream with blocked 724 stream buffer) so as to avoid inundating the stream with blocked
726 data. */ 725 data. */
727 Bufbyte chunkbuf[128]; 726 Bufbyte chunkbuf[128];
747 p->status_symbol = Qexit; 746 p->status_symbol = Qexit;
748 p->exit_code = ERROR_BROKEN_PIPE; 747 p->exit_code = ERROR_BROKEN_PIPE;
749 p->core_dumped = 0; 748 p->core_dumped = 0;
750 p->tick++; 749 p->tick++;
751 process_tick++; 750 process_tick++;
752 deactivate_process (proc); 751 deactivate_process (*((Lisp_Object *) (&vol_proc)));
753 error ("Broken pipe error sending to process %s; closed it", 752 error ("Broken pipe error sending to process %s; closed it",
754 XSTRING_DATA (p->name)); 753 XSTRING_DATA (p->name));
755 } 754 }
756 755
757 { 756 {
888 if (msg.message == XM_SOCKREPLY) 887 if (msg.message == XM_SOCKREPLY)
889 { 888 {
890 /* Ok, got an answer */ 889 /* Ok, got an answer */
891 if (WSAGETASYNCERROR(msg.lParam) == NO_ERROR) 890 if (WSAGETASYNCERROR(msg.lParam) == NO_ERROR)
892 success = 1; 891 success = 1;
892 else
893 {
894 warn_when_safe(Qstream, Qwarning,
895 "cannot get IP address for host \"%s\"",
896 XSTRING_DATA (host));
897 }
893 goto done; 898 goto done;
894 } 899 }
895 else if (msg.message == WM_TIMER && msg.wParam == SOCK_TIMER_ID) 900 else if (msg.message == WM_TIMER && msg.wParam == SOCK_TIMER_ID)
896 { 901 {
897 if (QUITP) 902 if (QUITP)
978 } 983 }
979 984
980 retval = connect (s, (struct sockaddr *) &address, sizeof (address)); 985 retval = connect (s, (struct sockaddr *) &address, sizeof (address));
981 if (retval != NO_ERROR && WSAGetLastError() != WSAEWOULDBLOCK) 986 if (retval != NO_ERROR && WSAGetLastError() != WSAEWOULDBLOCK)
982 goto connect_failed; 987 goto connect_failed;
983
984 /* Wait while connection is established */ 988 /* Wait while connection is established */
985 while (1) 989 while (1)
986 { 990 {
987 fd_set fdset; 991 fd_set fdset;
988 struct timeval tv; 992 struct timeval tv;
1021 0, FALSE, DUPLICATE_SAME_ACCESS); 1025 0, FALSE, DUPLICATE_SAME_ACCESS);
1022 return; 1026 return;
1023 1027
1024 connect_failed: 1028 connect_failed:
1025 closesocket (s); 1029 closesocket (s);
1030 warn_when_safe(Qstream, Qwarning,
1031 "failure to open network stream to host \"%s\" for service \"%s\"",
1032 XSTRING_DATA (host),
1033 XSTRING_DATA (service));
1026 report_file_error ("connection failed", list2 (host, name)); 1034 report_file_error ("connection failed", list2 (host, name));
1027 } 1035 }
1028 1036
1029 #endif 1037 #endif
1030 1038