1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-15 23:50:44 +00:00
freebsd-ports/net/delegate/files/patch-aa

40 lines
963 B
Plaintext
Raw Normal View History

1999-04-18 06:31:28 +00:00
--- 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;
}
1999-04-18 06:31:28 +00:00
+#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;
1999-04-18 06:31:28 +00:00
@@ -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;