Ticket #44: scapy.patch

File scapy.patch, 0.6 kB (added by t3rmin4t0r, 2 years ago)

replace select() with a custom loop with EINTR handling

  • scapy.py

    old new  
    14351435 
    14361436import socket, sys, getopt, string, struct, random, os, code 
    14371437import cPickle, copy, types, gzip, base64, re 
    1438 from select import select 
     1438import select as selectmod 
    14391439from fcntl import ioctl 
    14401440import fcntl 
    14411441 
     1442def select(_in, _out, _err, timeout=2): 
     1443        while True: 
     1444                try:  
     1445                        return selectmod.select(_in, _out, _err, timeout) 
     1446                except selectmod.error, (ec, es): 
     1447                        if (ec == 4): # EINTR 
     1448                                continue 
     1449                        else: 
     1450                                raise    
    14421451 
    14431452try: 
    14441453    import Gnuplot