summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--applets/applets.c2
-rw-r--r--editors/vi.c9
-rw-r--r--libbb/lineedit.c9
-rw-r--r--networking/arping.c3
5 files changed, 15 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index ac0e55027..49df1197d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
1VERSION = 1 1VERSION = 1
2PATCHLEVEL = 8 2PATCHLEVEL = 8
3SUBLEVEL = 2 3SUBLEVEL = 3
4EXTRAVERSION = 4EXTRAVERSION =
5NAME = Unnamed 5NAME = Unnamed
6 6
diff --git a/applets/applets.c b/applets/applets.c
index 1950cf34e..11340c4c7 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -17,7 +17,7 @@
17#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 17#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
18#warning Note that glibc is unsuitable for static linking anyway. 18#warning Note that glibc is unsuitable for static linking anyway.
19#warning If you still want to do it, remove -Wl,--gc-sections 19#warning If you still want to do it, remove -Wl,--gc-sections
20#warning from top-level Makefile and remove this warning. 20#warning from file scripts/trylink and remove this warning.
21#error Aborting compilation. 21#error Aborting compilation.
22#endif 22#endif
23 23
diff --git a/editors/vi.c b/editors/vi.c
index 345a9452d..9426ab855 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -184,6 +184,7 @@ struct globals {
184#if ENABLE_FEATURE_VI_COLON 184#if ENABLE_FEATURE_VI_COLON
185 char *initial_cmds[3]; // currently 2 entries, NULL terminated 185 char *initial_cmds[3]; // currently 2 entries, NULL terminated
186#endif 186#endif
187 char readbuffer[MAX_LINELEN];
187}; 188};
188#define G (*ptr_to_globals) 189#define G (*ptr_to_globals)
189#define text (G.text ) 190#define text (G.text )
@@ -200,6 +201,10 @@ struct globals {
200#define term_orig (G.term_orig ) 201#define term_orig (G.term_orig )
201#define term_vi (G.term_vi ) 202#define term_vi (G.term_vi )
202#define initial_cmds (G.initial_cmds ) 203#define initial_cmds (G.initial_cmds )
204#define readbuffer (G.readbuffer )
205#define INIT_G() do { \
206 PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
207} while (0)
203 208
204static int init_text_buffer(char *); // init from file or create new 209static int init_text_buffer(char *); // init from file or create new
205static void edit_file(char *); // edit one file 210static void edit_file(char *); // edit one file
@@ -321,7 +326,7 @@ int vi_main(int argc, char **argv)
321 my_pid = getpid(); 326 my_pid = getpid();
322#endif 327#endif
323 328
324 PTR_TO_GLOBALS = xzalloc(sizeof(G)); 329 INIT_G();
325 330
326#if ENABLE_FEATURE_VI_CRASHME 331#if ENABLE_FEATURE_VI_CRASHME
327 srand((long) my_pid); 332 srand((long) my_pid);
@@ -2142,8 +2147,6 @@ static int mysleep(int hund) // sleep for 'h' 1/100 seconds
2142 return safe_poll(pfd, 1, hund*10) > 0; 2147 return safe_poll(pfd, 1, hund*10) > 0;
2143} 2148}
2144 2149
2145#define readbuffer bb_common_bufsiz1
2146
2147static int readed_for_parse; 2150static int readed_for_parse;
2148 2151
2149//----- IO Routines -------------------------------------------- 2152//----- IO Routines --------------------------------------------
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index f65e852b1..4253054c5 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1211,7 +1211,7 @@ static void parse_prompt(const char *prmt_ptr)
1211#endif 1211#endif
1212 1212
1213#define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp) 1213#define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp)
1214#define getTermSettings(fd, argp) tcgetattr(fd, argp); 1214#define getTermSettings(fd, argp) tcgetattr(fd, argp)
1215 1215
1216static sighandler_t previous_SIGWINCH_handler; 1216static sighandler_t previous_SIGWINCH_handler;
1217 1217
@@ -1270,9 +1270,10 @@ int read_line_input(const char *prompt, char *command, int maxsize, line_input_t
1270 smalluint prevc; 1270 smalluint prevc;
1271#endif 1271#endif
1272 1272
1273 getTermSettings(0, (void *) &initial_settings); 1273 if (getTermSettings(0, (void *) &initial_settings) < 0
1274 /* Happens when e.g. stty -echo was run before */ 1274 /* Happens when e.g. stty -echo was run before */
1275 if (!(initial_settings.c_lflag & ECHO)) { 1275 || !(initial_settings.c_lflag & ECHO)
1276 ) {
1276 parse_prompt(prompt); 1277 parse_prompt(prompt);
1277 fflush(stdout); 1278 fflush(stdout);
1278 fgets(command, maxsize, stdin); 1279 fgets(command, maxsize, stdin);
diff --git a/networking/arping.c b/networking/arping.c
index 44615d5b1..a8ee9bf39 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -207,7 +207,8 @@ static int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
207 } 207 }
208 208
209 if (last) { 209 if (last) {
210 printf(" %u.%03ums\n", last / 1000, last % 1000); 210 unsigned diff = MONOTONIC_US() - last;
211 printf(" %u.%03ums\n", diff / 1000, diff % 1000);
211 } else { 212 } else {
212 printf(" UNSOLICITED?\n"); 213 printf(" UNSOLICITED?\n");
213 } 214 }