projects
/
dus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
906acfd
)
Removed the error when the tty size can not be obtained and just ignore it.
author
Francois Fleuret
<francois@fleuret.org>
Sun, 7 Mar 2010 10:47:44 +0000
(11:47 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Sun, 7 Mar 2010 10:47:44 +0000
(11:47 +0100)
dus.c
patch
|
blob
|
history
diff --git
a/dus.c
b/dus.c
index
736b136
..
6e39dca
100644
(file)
--- a/
dus.c
+++ b/
dus.c
@@
-347,6
+347,7
@@
void print_help(FILE *out) {
int main(int argc, char **argv) {
int c;
struct file_with_size *root;
int main(int argc, char **argv) {
int c;
struct file_with_size *root;
+ struct winsize win;
root = 0;
root = 0;
@@
-420,12
+421,8
@@
int main(int argc, char **argv) {
}
}
}
}
- if(isatty(STDOUT_FILENO)) {
- struct winsize win;
- if(ioctl (STDOUT_FILENO, TIOCGWINSZ, (char *) &win)) {
- fprintf(stderr, "Can not get the tty size: %s\n", strerror(errno));
- exit (EXIT_FAILURE);
- }
+ if(isatty(STDOUT_FILENO) &&
+ !ioctl (STDOUT_FILENO, TIOCGWINSZ, (char *) &win)) {
print_sorted(root, win.ws_col, win.ws_row - 2);
} else {
print_sorted(root, -1, -1);
print_sorted(root, win.ws_col, win.ws_row - 2);
} else {
print_sorted(root, -1, -1);