diff options
author | Karel Zak <kzak@redhat.com> | 2006-12-07 00:25:58 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2006-12-07 00:25:58 +0100 |
commit | 63cccae4684f83d2a462bc8abf24e51d1bd6efb6 (patch) | |
tree | 433db3f0b44e0f46e4130141f4a59db9c3564557 /text-utils/more.c | |
parent | a2c5f3cadcfd2ceab9d37fc847fa0d800a95633a (diff) | |
download | util-linux-old-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.gz |
Imported from util-linux-2.11t tarball.
Diffstat (limited to 'text-utils/more.c')
-rw-r--r-- | text-utils/more.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/text-utils/more.c b/text-utils/more.c index 130f1020..8a5640a4 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -1439,7 +1439,8 @@ int command (char *filename, register FILE *f) kill_line (); if (Senter && Sexit) { my_putstring (Senter); - promptlen = pr (_("[Press 'h' for instructions.]")) + (2 * soglitch); + promptlen = pr (_("[Press 'h' for instructions.]")) + + 2 * soglitch; my_putstring (Sexit); } else @@ -1794,13 +1795,13 @@ retry: * Wait until we're in the foreground before we save the * the terminal modes. */ - if (ioctl(fileno(stdout), TIOCGPGRP, &tgrp) < 0) { - perror("TIOCGPGRP"); - exit(1); + if ((tgrp = tcgetpgrp(fileno(stdout))) < 0) { + perror("tcgetpgrp"); + exit(1); } if (tgrp != getpgrp(0)) { - kill(0, SIGTTOU); - goto retry; + kill(0, SIGTTOU); + goto retry; } } #endif @@ -1903,7 +1904,7 @@ int readch () { unsigned char c; errno = 0; - if (read (2, &c, 1) <= 0) { + if (read (fileno(stderr), &c, 1) <= 0) { if (errno != EINTR) end_it(0); else |