args += ["python", "-m", "pdm.sshsock", path]
self.proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
fcntl.fcntl(self.proc.stdout, fcntl.F_SETFL, fcntl.fcntl(self.proc.stdout, fcntl.F_GETFL) | os.O_NONBLOCK)
args += ["python", "-m", "pdm.sshsock", path]
self.proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
fcntl.fcntl(self.proc.stdout, fcntl.F_SETFL, fcntl.fcntl(self.proc.stdout, fcntl.F_GETFL) | os.O_NONBLOCK)
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, fcntl.fcntl(sys.stdin, fcntl.F_GETFL) | os.O_NONBLOCK)
sk = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
try:
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, fcntl.fcntl(sys.stdin, fcntl.F_GETFL) | os.O_NONBLOCK)
sk = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
try:
- sk.connect(sys.argv[1])
+ try:
+ sk.connect(sys.argv[1])
+ except socket.error as err:
+ sys.stdout.write("SSOCK-connect: %s\n" % err)
+ return
+ sys.stdout.write("SSOCK+\n")