aboutsummaryrefslogtreecommitdiff
path: root/editors/emacs23/files/patch-src:process.c
blob: 884d06d9a1c677204423d77240bd80c22aeabd7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- src/process.c.orig	Mon Mar 17 07:06:56 2003
+++ src/process.c	Fri Apr 23 19:28:58 2004
@@ -1891,10 +1891,34 @@
 	   Likewise for immediate_quit.  */
 	break;
 
+#if 1
+      if ( (errno == EINTR ) || (errno == EINPROGRESS)){
+	fd_set fds;
+	int e;
+	struct timeval tv;
+	tv.tv_sec =60;
+	tv.tv_usec = 0;
+	FD_ZERO(&fds);
+	FD_SET(s, &fds);
+      resel:
+        QUIT;
+	e = select(s+1, NULL, &fds, NULL, &tv);
+
+	if( e == -1){
+	  if(errno == EINTR)
+	    goto resel;
+	  else
+	    xerrno = ETIMEDOUT;
+	}
+	else {
+	  xerrno = 0;
+	  break;
+	}
+      }
+#endif
+
       immediate_quit = 0;
 
-      if (xerrno == EINTR)
-	goto loop;
       if (xerrno == EADDRINUSE && retry < 20)
 	{
 	  /* A delay here is needed on some FreeBSD systems,
@@ -2001,10 +2025,30 @@
     {
       int xerrno = errno;
 
+#if 1
+      if ( (errno == EINTR ) || (errno == EINPROGRESS)){
+	fd_set fds;
+	int e;
+	struct timeval tv;
+	tv.tv_sec =60;
+	tv_tv_usec = 0;
+	FD_CLEAR(&fds);
+	FD_SET(s, &fds);
+      resel:
+        QUIT;
+	e = select(s+1, NULL, fds, NULL, &tv);
+	if( e != 0){
+	  if(errno == EINTR)
+	    goto resel;
+	  else
+	    xerrno = ETIMEDOUT;
+	}
+	else 
+	  xerrno = 0;
+      }
+#endif
       immediate_quit = 0;
 
-      if (errno == EINTR)
-	goto loop;
       if (errno == EADDRINUSE && retry < 20)
 	{
 	  /* A delay here is needed on some FreeBSD systems,