Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 027188a

Browse files
committed
According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
list (of bsd variants that have a different lock structure).
1 parent 5ef8f0c commit 027188a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/posixfile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ def lock(self, how, *args):
177177
# Hack by [email protected] to get locking to go on freebsd;
178178
# additions for AIX by [email protected]
179179
import sys, os
180-
if sys.platform in ('netbsd1', 'freebsd2', 'freebsd3'):
180+
if sys.platform in ('netbsd1',
181+
'freebsd2', 'freebsd3',
182+
'bsdos2', 'bsdos3', 'bsdos4'):
181183
flock = struct.pack('lxxxxlxxxxlhh', \
182184
l_start, l_len, os.getpid(), l_type, l_whence)
183185
elif sys.platform in ['aix3', 'aix4']:
@@ -190,7 +192,9 @@ def lock(self, how, *args):
190192
flock = fcntl.fcntl(self._file_.fileno(), cmd, flock)
191193

192194
if '?' in how:
193-
if sys.platform in ('netbsd1', 'freebsd2', 'freebsd3'):
195+
if sys.platform in ('netbsd1',
196+
'freebsd2', 'freebsd3',
197+
'bsdos2', 'bsdos3', 'bsdos4'):
194198
l_start, l_len, l_pid, l_type, l_whence = \
195199
struct.unpack('lxxxxlxxxxlhh', flock)
196200
elif sys.platform in ['aix3', 'aix4']:

0 commit comments

Comments
 (0)