summaryrefslogtreecommitdiff
path: root/lang/python25/files/patch-Lib-test-test_ioctl.py
blob: b354e097c21a8de645ad8f53fbe557b385606ec1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- Lib/test/test_ioctl.py.orig	2008-08-03 20:45:34.000000000 -0400
+++ Lib/test/test_ioctl.py	2010-06-24 13:26:52.000000000 -0400
@@ -44,21 +44,12 @@ class IoctlTests(unittest.TestCase):
             raise TestSkipped('pty module required')
         mfd, sfd = pty.openpty()
         try:
-            if termios.TIOCSWINSZ < 0:
-                set_winsz_opcode_maybe_neg = termios.TIOCSWINSZ
-                set_winsz_opcode_pos = termios.TIOCSWINSZ & 0xffffffffL
-            else:
-                set_winsz_opcode_pos = termios.TIOCSWINSZ
-                set_winsz_opcode_maybe_neg, = struct.unpack("i",
-                        struct.pack("I", termios.TIOCSWINSZ))
-
+            set_winsz_opcode = termios.TIOCSWINSZ
             # We're just testing that these calls do not raise exceptions.
             saved_winsz = fcntl.ioctl(mfd, termios.TIOCGWINSZ, "\0"*8)
             our_winsz = struct.pack("HHHH",80,25,0,0)
-            # test both with a positive and potentially negative ioctl code
-            new_winsz = fcntl.ioctl(mfd, set_winsz_opcode_pos, our_winsz)
-            new_winsz = fcntl.ioctl(mfd, set_winsz_opcode_maybe_neg, our_winsz)
-            fcntl.ioctl(mfd, set_winsz_opcode_maybe_neg, saved_winsz)
+            new_winsz = fcntl.ioctl(mfd, set_winsz_opcode, our_winsz)
+            fcntl.ioctl(mfd, set_winsz_opcode, saved_winsz)
         finally:
             os.close(mfd)
             os.close(sfd)