]> granicus.if.org Git - python/commitdiff
Assume a 64-bit start and len if O_LARGEFILE is available.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 18 Oct 2001 22:07:48 +0000 (22:07 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 18 Oct 2001 22:07:48 +0000 (22:07 +0000)
Lib/test/test_fcntl.py

index a64a5e1b6169dbeeac46d6c5d7e5067bb8b56a6a..e44624928f096d4a4d19b77adfb1aefeecaff4f2 100755 (executable)
@@ -9,6 +9,13 @@ from test_support import verbose, TESTFN
 
 filename = TESTFN
 
+try:
+    os.O_LARGEFILE
+except AttributeError:
+    start_len = "ll"
+else:
+    start_len = "qq"
+
 if sys.platform in ('netbsd1', 'Darwin1.2', 'darwin1',
                     'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
                     'bsdos2', 'bsdos3', 'bsdos4',
@@ -17,7 +24,7 @@ if sys.platform in ('netbsd1', 'Darwin1.2', 'darwin1',
 elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']:
     lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
 else:
-    lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
+    lockdata = struct.pack('hh'+start_len+'hh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
 if verbose:
     print 'struct.pack: ', `lockdata`