chiark / gitweb /
bus-policy: append items rather than prepending them
[elogind.git] / src / shared / pty.c
index 11d76f825fd890d2569ba52924cf035047816424..31123e5af20636e71476ae52043327af5e99ba5b 100644 (file)
@@ -45,6 +45,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <limits.h>
+#include <linux/ioctl.h>
 #include <pty.h>
 #include <signal.h>
 #include <stdbool.h>
@@ -105,6 +106,7 @@ int pty_new(Pty **out) {
 
         pty->ref = 1;
         pty->fd = -1;
+        pty->barrier = (Barrier) BARRIER_NULL;
 
         pty->fd = posix_openpt(O_RDWR | O_NOCTTY | O_CLOEXEC | O_NONBLOCK);
         if (pty->fd < 0)
@@ -127,7 +129,7 @@ int pty_new(Pty **out) {
         if (r < 0)
                 return -errno;
 
-        r = barrier_init(&pty->barrier);
+        r = barrier_create(&pty->barrier);
         if (r < 0)
                 return r;