diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-18 20:12:13 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-18 20:12:44 -0400 |
commit | 7566e26721ee95d6fc864e9e6654fb61bd3cd603 (patch) | |
tree | 4ac5f457cee12ccbea45f5c90eabe76cbd1444be /src/shared/pty.c | |
parent | cbd4560ea2c9f0ae77df1fc64685ff4e559810b6 (diff) |
barrier: initalize file descriptors with -1
Explicitly initalize descriptors using explicit assignment like
bus_error. This makes barriers follow the same conventions as
everything else and makes things a bit simpler too.
Rename barier_init to barier_create so it is obvious that it is
not about initialization.
Remove some parens, etc.
Diffstat (limited to 'src/shared/pty.c')
-rw-r--r-- | src/shared/pty.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/pty.c b/src/shared/pty.c index 11d76f825f..2863da489c 100644 --- a/src/shared/pty.c +++ b/src/shared/pty.c @@ -105,6 +105,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 +128,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; |