]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
python-lxc: don't use private lxc/utils.h
authorAleksandr Mezin <mezin.alexander@gmail.com>
Thu, 26 May 2016 10:07:28 +0000 (16:07 +0600)
committerAleksandr Mezin <mezin.alexander@gmail.com>
Fri, 27 May 2016 12:05:09 +0000 (18:05 +0600)
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
src/python-lxc/lxc.c

index 61c192c870e0b81b6561623c48a7f5f4ebf06421..fbbabdb8fa9811cbad0fd52d2525cc5104305dc1 100644 (file)
@@ -25,7 +25,6 @@
 #include <Python.h>
 #include "structmember.h"
 #include <lxc/lxccontainer.h>
-#include "lxc/utils.h"
 #include "lxc/confile.h"
 #include <stdio.h>
 #include <sys/wait.h>
 
 /* Helper functions */
 
+/* Copied from lxc/utils.c */
+static int lxc_wait_for_pid_status(pid_t pid)
+{
+    int status, ret;
+
+again:
+    ret = waitpid(pid, &status, 0);
+    if (ret == -1) {
+        if (errno == EINTR)
+            goto again;
+        return -1;
+    }
+    if (ret != pid)
+        goto again;
+    return status;
+}
+
 char**
 convert_tuple_to_char_pointer_array(PyObject *argv) {
     int argc;