ports/databases/gdbm/files/patch-src_lock.c
Alexey Dokuchaev bcacfbf99b databases/gdbm: update GNU dbm port to version 1.25
Pull upstream commit to not set `errno' to ETIME (which does
not exist on FreeBSD) and preserve the original EINTR instead.

Reported by:	portscout
2025-04-17 14:27:38 +00:00

35 lines
759 B
C

--- src/lock.c.orig 2025-03-06 16:24:09 UTC
+++ src/lock.c
@@ -73,15 +73,10 @@ try_lock_flock (GDBM_FILE dbf, int nb)
{
return TRY_LOCK_OK;
}
- else if (errno == EWOULDBLOCK)
+ else if (errno == EWOULDBLOCK || errno == EINTR)
{
return TRY_LOCK_FAIL;
}
- else if (errno == EINTR)
- {
- errno = ETIME;
- return TRY_LOCK_FAIL;
- }
#endif
return TRY_LOCK_NEXT;
}
@@ -116,7 +111,6 @@ try_lock_lockf (GDBM_FILE dbf, int nb)
switch (errno)
{
case EINTR:
- errno = ETIME;
case EACCES:
case EAGAIN:
case EDEADLK:
@@ -162,7 +156,6 @@ try_lock_fcntl (GDBM_FILE dbf, int nb)
switch (errno)
{
case EINTR:
- errno = ETIME;
case EACCES:
case EAGAIN:
case EDEADLK: