projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libbb: remove glibc-style bloat from sha_crypt. -1130 bytes.
[oweals/busybox.git]
/
util-linux
/
more.c
diff --git
a/util-linux/more.c
b/util-linux/more.c
index ee559b102eb7dc0d03af7abcc256ea3841f15751..cf8e137eb56d6c4680b3de3cfce34547e7b4b407 100644
(file)
--- a/
util-linux/more.c
+++ b/
util-linux/more.c
@@
-28,9
+28,7
@@
struct globals {
struct termios new_settings;
};
#define G (*(struct globals*)bb_common_bufsiz1)
struct termios new_settings;
};
#define G (*(struct globals*)bb_common_bufsiz1)
-//#define G (*ptr_to_globals)
#define INIT_G() ((void)0)
#define INIT_G() ((void)0)
-//#define INIT_G() PTR_TO_GLOBALS = xzalloc(sizeof(G))
#define initial_settings (G.initial_settings)
#define new_settings (G.new_settings )
#define cin_fileno (G.cin_fileno )
#define initial_settings (G.initial_settings)
#define new_settings (G.new_settings )
#define cin_fileno (G.cin_fileno )
@@
-38,7
+36,7
@@
struct globals {
#define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp)
#define getTermSettings(fd, argp) tcgetattr(fd, argp)
#define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp)
#define getTermSettings(fd, argp) tcgetattr(fd, argp)
-static void gotsig(int sig)
+static void gotsig(int sig
UNUSED_PARAM
)
{
bb_putchar('\n');
setTermSettings(cin_fileno, &initial_settings);
{
bb_putchar('\n');
setTermSettings(cin_fileno, &initial_settings);
@@
-53,7
+51,7
@@
static void gotsig(int sig)
#define CONVERTED_TAB_SIZE 8
int more_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
#define CONVERTED_TAB_SIZE 8
int more_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int more_main(int argc, char **argv)
+int more_main(int argc
UNUSED_PARAM
, char **argv)
{
int c = c; /* for gcc */
int lines;
{
int c = c; /* for gcc */
int lines;
@@
-64,8
+62,8
@@
int more_main(int argc, char **argv)
FILE *file;
FILE *cin;
int len;
FILE *file;
FILE *cin;
int len;
-
int
terminal_width;
-
int
terminal_height;
+
unsigned
terminal_width;
+
unsigned
terminal_height;
INIT_G();
INIT_G();
@@
-74,7
+72,7
@@
int more_main(int argc, char **argv)
* is not a tty and turns into cat. This makes sense. */
if (!isatty(STDOUT_FILENO))
return bb_cat(argv);
* is not a tty and turns into cat. This makes sense. */
if (!isatty(STDOUT_FILENO))
return bb_cat(argv);
- cin = fopen
(CURRENT_TTY, "r"
);
+ cin = fopen
_for_read(CURRENT_TTY
);
if (!cin)
return bb_cat(argv);
if (!cin)
return bb_cat(argv);
@@
-87,9
+85,11
@@
int more_main(int argc, char **argv)
new_settings.c_cc[VMIN] = 1;
new_settings.c_cc[VTIME] = 0;
setTermSettings(cin_fileno, &new_settings);
new_settings.c_cc[VMIN] = 1;
new_settings.c_cc[VTIME] = 0;
setTermSettings(cin_fileno, &new_settings);
- signal(SIGINT, gotsig);
- signal(SIGQUIT, gotsig);
- signal(SIGTERM, gotsig);
+ bb_signals(0
+ + (1 << SIGINT)
+ + (1 << SIGQUIT)
+ + (1 << SIGTERM)
+ , gotsig);
#endif
do {
#endif
do {
@@
-165,7
+165,7
@@
int more_main(int argc, char **argv)
if (c == '\t') {
spaces = CONVERTED_TAB_SIZE - 1;
c = ' ';
if (c == '\t') {
spaces = CONVERTED_TAB_SIZE - 1;
c = ' ';
- }
+ }
/*
* There are two input streams to worry about here:
/*
* There are two input streams to worry about here: