aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/more.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-11-28 16:56:53 -0600
committerRob Landley <rob@landley.net>2014-11-28 16:56:53 -0600
commit75fea678c039381b310d15a86d698cba7ec9805d (patch)
tree5779ca34eae37abdf88427c768e3593b7253b0b8 /toys/pending/more.c
parentdc5bd766762ae5f97bad7969f711e721b05aed63 (diff)
downloadtoybox-75fea678c039381b310d15a86d698cba7ec9805d.tar.gz
Tiny in-passing cleanups to more.c.
Diffstat (limited to 'toys/pending/more.c')
-rw-r--r--toys/pending/more.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/toys/pending/more.c b/toys/pending/more.c
index 9d89626a..eb48fa7b 100644
--- a/toys/pending/more.c
+++ b/toys/pending/more.c
@@ -17,7 +17,6 @@ config MORE
#define FOR_more
#include "toys.h"
-#include <signal.h>
GLOBALS(
struct termios inf;
@@ -52,7 +51,6 @@ void more_main()
if (!isatty(STDOUT_FILENO) || !(cin = fopen("/dev/tty", "r"))) {
loopfiles(toys.optargs, do_cat_operation);
- toys.exitval = 0;
return;
}
@@ -89,7 +87,7 @@ void more_main()
if (st.st_size)
more_msg_len += printf("(%d%% of %lld bytes)",
(int) (100 * ( (double) ftell(fp) / (double) st.st_size)),
- st.st_size);
+ (long long)st.st_size);
fflush(NULL);
while (1) {
@@ -117,5 +115,6 @@ void more_main()
stop:
tcsetattr(TT.cin_fd, TCSANOW, &TT.inf);
fclose(cin);
+ // Even if optarg not found, exit value still 0
toys.exitval = 0;
}