diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-10 14:14:09 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-10 14:14:09 +0000 |
commit | 12abcb36c871f4c97d7aed3d9bd55e5477888bb7 (patch) | |
tree | d526460c2d752fca87fb8735c5ce3dbc0d9caade /miscutils/less.c | |
parent | 311c19a661fb8e8cc85d131c1b87a6b80a89ef7c (diff) | |
download | busybox-w32-12abcb36c871f4c97d7aed3d9bd55e5477888bb7.tar.gz busybox-w32-12abcb36c871f4c97d7aed3d9bd55e5477888bb7.tar.bz2 busybox-w32-12abcb36c871f4c97d7aed3d9bd55e5477888bb7.zip |
libiproute: fix buggy open check: s/if (fd)/if (fd >= 0)/
less: small optimization -15 bytes
Diffstat (limited to 'miscutils/less.c')
-rw-r--r-- | miscutils/less.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index 36d451271..27855bbe8 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
@@ -774,9 +774,7 @@ static void buffer_line(int linenum) | |||
774 | static void open_file_and_read_lines(void) | 774 | static void open_file_and_read_lines(void) |
775 | { | 775 | { |
776 | if (filename) { | 776 | if (filename) { |
777 | int fd = xopen(filename, O_RDONLY); | 777 | xmove_fd(xopen(filename, O_RDONLY), STDIN_FILENO); |
778 | dup2(fd, 0); | ||
779 | if (fd) close(fd); | ||
780 | } else { | 778 | } else { |
781 | /* "less" with no arguments in argv[] */ | 779 | /* "less" with no arguments in argv[] */ |
782 | /* For status line only */ | 780 | /* For status line only */ |