chiark / gitweb /
Bump version to 7.0.1~iwj0
[chiark-utils.git] / fishdescriptor / py / fishdescriptor / indonor.py
index dcd447a39090c9a6d3321b359af1ccf31fae2de7..d911bf85c52d772a10bf7e3ad9f715eba670149f 100644 (file)
@@ -1,4 +1,23 @@
 
+# This file is part of chiark-utils, a collection of useful programs
+# used on chiark.greenend.org.uk.
+#
+# This file is:
+#  Copyright 2018 Citrix Systems Ltd
+#
+# This is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, consult the Free Software Foundation's
+# website at www.fsf.org, or the GNU Project website at www.gnu.org.
+
 # class for use inside gdb which is debugging the donor process
 
 from __future__ import print_function
@@ -8,6 +27,7 @@ import copy
 import os
 import sys
 import socket
+import errno
 
 def _string_bytearray(s):
     # gets us bytes in py2 and py3
@@ -123,7 +143,7 @@ class DonorImplementation():
         # in my browser).  Also the error is very nonspecific :-/.
         # This seems to happen on jessie, and is fixed in stretch.
         # Anyway:
-        return parse_eval(expr_pat % '(*((int (*)(void))__errno_location)())')
+        return parse_eval(expr_pat % '(*((int*(*)(void))__errno_location)())')
 
     # calling functions (need to cast the function name to the right
     # type in case maybe gdb doesn't know the type)
@@ -193,7 +213,7 @@ class DonorImplementation():
         )
         if r < 0:
             errnoval = di._parse_eval_errno('%s')
-            if errnoval != os.errno.EEXIST:
+            if errnoval != errno.EEXIST:
                 raise RuntimeError("mkdir %s failed: `%s'" %
                                    (repr(path), os.strerror(errnoval)))
             return 0