aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2018-11-19 10:05:11 -0800
committerPaul Eggert2018-11-19 11:38:20 -0800
commit95ea5c257cde5e692ff3adc2b1f75c9f583b91a6 (patch)
tree761cbc8005aea5298bc40e50190dd1552c1c58f3 /lib-src
parent51f9c5a6d16bcba6182cb9bbb9b09330cd6d0a86 (diff)
downloademacs-95ea5c257cde5e692ff3adc2b1f75c9f583b91a6.tar.gz
emacs-95ea5c257cde5e692ff3adc2b1f75c9f583b91a6.zip
emacsclient.c: use STDOUT_FILENO
* lib-src/emacsclient.c (find_tty, handle_sigcont, main): Use STDOUT_FILENO instead of fileno (stdout) or magic 1.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c0721c049d2..7e7b2a3b0c5 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1079,7 +1079,7 @@ static bool
1079find_tty (const char **tty_type, const char **tty_name, bool noabort) 1079find_tty (const char **tty_type, const char **tty_name, bool noabort)
1080{ 1080{
1081 const char *type = egetenv ("TERM"); 1081 const char *type = egetenv ("TERM");
1082 const char *name = ttyname (fileno (stdout)); 1082 const char *name = ttyname (STDOUT_FILENO);
1083 1083
1084 if (!name) 1084 if (!name)
1085 { 1085 {
@@ -1162,7 +1162,7 @@ handle_sigcont (int signalnum)
1162{ 1162{
1163 int old_errno = errno; 1163 int old_errno = errno;
1164 pid_t pgrp = getpgrp (); 1164 pid_t pgrp = getpgrp ();
1165 pid_t tcpgrp = tcgetpgrp (1); 1165 pid_t tcpgrp = tcgetpgrp (STDOUT_FILENO);
1166 1166
1167 if (tcpgrp == pgrp) 1167 if (tcpgrp == pgrp)
1168 { 1168 {
@@ -1677,7 +1677,7 @@ main (int argc, char **argv)
1677 if (tty) 1677 if (tty)
1678 { 1678 {
1679 pid_t pgrp = getpgrp (); 1679 pid_t pgrp = getpgrp ();
1680 pid_t tcpgrp = tcgetpgrp (1); 1680 pid_t tcpgrp = tcgetpgrp (STDOUT_FILENO);
1681 if (0 <= tcpgrp && tcpgrp != pgrp) 1681 if (0 <= tcpgrp && tcpgrp != pgrp)
1682 kill (-pgrp, SIGTTIN); 1682 kill (-pgrp, SIGTTIN);
1683 } 1683 }
@@ -1854,7 +1854,7 @@ main (int argc, char **argv)
1854 skiplf = false; 1854 skiplf = false;
1855 } 1855 }
1856 fflush (stdout); 1856 fflush (stdout);
1857 while (fdatasync (1) != 0 && errno == EINTR) 1857 while (fdatasync (STDOUT_FILENO) != 0 && errno == EINTR)
1858 continue; 1858 continue;
1859 1859
1860 /* Now, wait for an answer and print any messages. */ 1860 /* Now, wait for an answer and print any messages. */
@@ -1961,7 +1961,7 @@ main (int argc, char **argv)
1961 if (!skiplf) 1961 if (!skiplf)
1962 printf ("\n"); 1962 printf ("\n");
1963 fflush (stdout); 1963 fflush (stdout);
1964 while (fdatasync (1) != 0 && errno == EINTR) 1964 while (fdatasync (STDOUT_FILENO) != 0 && errno == EINTR)
1965 continue; 1965 continue;
1966 1966
1967 if (rl < 0) 1967 if (rl < 0)