summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2014-03-23 01:29:43 -0700
committerDaniel Colascione <dancol@dancol.org>2014-03-23 01:29:43 -0700
commita31161883b07ae38dbb5e3b74ebf0131d2029bf8 (patch)
tree03314f5130ca8074ff4ff80a09cfa0f01c1d9d72 /src/term.c
parent6ddc44225e743e2b2a0d5c192f50aefd7a4a915b (diff)
downloademacs-a31161883b07ae38dbb5e3b74ebf0131d2029bf8.tar.gz
Improve init_tty readability
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/term.c b/src/term.c
index 773e85faabc..3bcbb70aff6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4031,12 +4031,15 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
open a frame on the same terminal. */
int flags = O_RDWR | O_NOCTTY | (ctty ? 0 : O_IGNORE_CTTY);
int fd = emacs_open (name, flags, 0);
- tty->input = tty->output = fd < 0 || ! isatty (fd) ? 0 : fdopen (fd, "w+");
+ tty->input = tty->output =
+ ((fd < 0 || ! isatty (fd))
+ ? NULL
+ : fdopen (fd, "w+"));
if (! tty->input)
{
char const *diagnostic
- = tty->input ? "Not a tty device: %s" : "Could not open file: %s";
+ = (fd < 0) ? "Could not open file: %s" : "Not a tty device: %s";
emacs_close (fd);
maybe_fatal (must_succeed, terminal, diagnostic, diagnostic, name);
}