emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116855: Improve init_tty readability


From: Daniel Colascione
Subject: [Emacs-diffs] trunk r116855: Improve init_tty readability
Date: Sun, 23 Mar 2014 08:29:55 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116855
revision-id: address@hidden
parent: address@hidden
committer: Daniel Colascione <address@hidden>
branch nick: trunk
timestamp: Sun 2014-03-23 01:29:43 -0700
message:
  Improve init_tty readability
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/term.c                     term.c-20091113204419-o5vbwnq5f7feedwu-220
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-03-23 05:15:48 +0000
+++ b/src/ChangeLog     2014-03-23 08:29:43 +0000
@@ -1,5 +1,10 @@
 2014-03-23  Daniel Colascione  <address@hidden>
 
+       * term.c (init_tty): Rearrange condition for clarity; print
+       appropriate diagnostic.
+
+2014-03-23  Daniel Colascione  <address@hidden>
+
        * process.c (DATAGRAM_CONN_P): Don't underflow datagram_address
        array.  (ASAN caught.)
 

=== modified file 'src/term.c'
--- a/src/term.c        2014-03-20 14:09:37 +0000
+++ b/src/term.c        2014-03-23 08:29:43 +0000
@@ -4031,12 +4031,15 @@
        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);
       }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]