summaryrefslogtreecommitdiff
path: root/lib-src/emacsclient.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-11-19 10:05:11 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2018-11-19 11:38:20 -0800
commit95ea5c257cde5e692ff3adc2b1f75c9f583b91a6 (patch)
tree761cbc8005aea5298bc40e50190dd1552c1c58f3 /lib-src/emacsclient.c
parent51f9c5a6d16bcba6182cb9bbb9b09330cd6d0a86 (diff)
downloademacs-95ea5c257cde5e692ff3adc2b1f75c9f583b91a6.tar.gz
emacs-95ea5c257cde5e692ff3adc2b1f75c9f583b91a6.tar.bz2
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/emacsclient.c')
-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
find_tty (const char **tty_type, const char **tty_name, bool noabort)
{
const char *type = egetenv ("TERM");
- const char *name = ttyname (fileno (stdout));
+ const char *name = ttyname (STDOUT_FILENO);
if (!name)
{
@@ -1162,7 +1162,7 @@ handle_sigcont (int signalnum)
{
int old_errno = errno;
pid_t pgrp = getpgrp ();
- pid_t tcpgrp = tcgetpgrp (1);
+ pid_t tcpgrp = tcgetpgrp (STDOUT_FILENO);
if (tcpgrp == pgrp)
{
@@ -1677,7 +1677,7 @@ main (int argc, char **argv)
if (tty)
{
pid_t pgrp = getpgrp ();
- pid_t tcpgrp = tcgetpgrp (1);
+ pid_t tcpgrp = tcgetpgrp (STDOUT_FILENO);
if (0 <= tcpgrp && tcpgrp != pgrp)
kill (-pgrp, SIGTTIN);
}
@@ -1854,7 +1854,7 @@ main (int argc, char **argv)
skiplf = false;
}
fflush (stdout);
- while (fdatasync (1) != 0 && errno == EINTR)
+ while (fdatasync (STDOUT_FILENO) != 0 && errno == EINTR)
continue;
/* Now, wait for an answer and print any messages. */
@@ -1961,7 +1961,7 @@ main (int argc, char **argv)
if (!skiplf)
printf ("\n");
fflush (stdout);
- while (fdatasync (1) != 0 && errno == EINTR)
+ while (fdatasync (STDOUT_FILENO) != 0 && errno == EINTR)
continue;
if (rl < 0)