summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2005-04-04 15:21:04 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2005-04-04 15:21:04 (GMT)
commitac89f6ef295465a18a1fcac445bf93ad3722edcb (patch)
tree913b8dc5b21d6cf6d500a3672410f79f1dcc980a
parent99358df865471f35574992ebf5ef7e4108637de8 (diff)
downloadcpython-ac89f6ef295465a18a1fcac445bf93ad3722edcb.zip
cpython-ac89f6ef295465a18a1fcac445bf93ad3722edcb.tar.gz
cpython-ac89f6ef295465a18a1fcac445bf93ad3722edcb.tar.bz2
Fix testcase for 64bit BSD systems: long is 8 bytes for those systems
so there's no need to pad after off_t members. And a small typo fix.
-rwxr-xr-xLib/test/test_fcntl.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index dedf367..2d176ea 100755
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -24,7 +24,13 @@ if sys.platform in ('netbsd1', 'Darwin1.2', 'darwin',
'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5', 'freebsd6',
'bsdos2', 'bsdos3', 'bsdos4',
'openbsd', 'openbsd2', 'openbsd3'):
- lockdata = struct.pack('lxxxxlxxxxlhh', 0, 0, 0, fcntl.F_WRLCK, 0)
+ if struct.calcsize('l') == 8:
+ off_t = 'l'
+ pid_t = 'i'
+ else:
+ off_t = 'lxxxx'
+ pid_t = 'l'
+ lockdata = struct.pack(off_t+off_t+pid_t+'hh', 0, 0, 0, fcntl.F_WRLCK, 0)
elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']:
lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
elif sys.platform in ['os2emx']:
@@ -39,7 +45,7 @@ if lockdata:
f = open(filename, 'w')
rv = fcntl.fcntl(f.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
if verbose:
- print 'Status from fnctl with O_NONBLOCK: ', rv
+ print 'Status from fcntl with O_NONBLOCK: ', rv
if sys.platform not in ['os2emx']:
rv = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW, lockdata)