summaryrefslogtreecommitdiffstats
path: root/text-utils/more.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:58 +0100
committerKarel Zak2006-12-07 00:25:58 +0100
commit63cccae4684f83d2a462bc8abf24e51d1bd6efb6 (patch)
tree433db3f0b44e0f46e4130141f4a59db9c3564557 /text-utils/more.c
parentImported from util-linux-2.11r tarball. (diff)
downloadkernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.gz
kernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.xz
kernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.zip
Imported from util-linux-2.11t tarball.
Diffstat (limited to 'text-utils/more.c')
-rw-r--r--text-utils/more.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/text-utils/more.c b/text-utils/more.c
index 130f1020f..8a5640a43 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