1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-05 22:43:24 +00:00
freebsd-ports/net/delegate/files/patch-aa
Masafumi Max NAKANE 39d58d3d95 Upgrade to 5.9.1.
1999-04-18 06:31:28 +00:00

40 lines
963 B
Plaintext

--- src/lock.c.orig Mon Mar 15 19:24:15 1999
+++ src/lock.c Sun Apr 18 15:26:15 1999
@@ -136,6 +136,22 @@
break;
}
+#ifdef EWOULDBLOCK
+ /*
+ * Only retry the lock if it was busy. Other
+ * possible sources for the lock to fail are:
+ * invalid argument, bad filedescriptor, and
+ * operation not supported by device. The latter
+ * happens if you start DeleGateD with -v, so it
+ * logs to stderr (which usually doesn't support
+ * locking at all).
+ */
+ if (rcode == -1 && errno != EWOULDBLOCK) {
+ /* pretend lock succeeded */
+ rcode = 0;
+ break;
+ }
+#endif
remain = timeout - elapsed;
if( remain <= 0 )
break;
@@ -146,6 +162,13 @@
start = Time();
rcode = callFuncTimeout(remain/1000,-1,func,fd);
+#ifdef EWOULDBLOCK
+ if (rcode == -1 && errno != EWOULDBLOCK) {
+ /* pretend lock succeeded */
+ rcode = 0;
+ break;
+ }
+#endif
elapse1 = (Time() - start) * 1000;
/*{
static int n;