--- busybox-1.8.2/libbb/lineedit.c	Sat Nov 10 01:40:52 2007
+++ busybox-1.8.2-lineedit/libbb/lineedit.c	Sun Feb 10 11:10:24 2008
@@ -1211,7 +1211,7 @@
 #endif
 
 #define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp)
-#define getTermSettings(fd, argp) tcgetattr(fd, argp);
+#define getTermSettings(fd, argp) tcgetattr(fd, argp)
 
 static sighandler_t previous_SIGWINCH_handler;
 
@@ -1270,9 +1270,10 @@
 	smalluint prevc;
 #endif
 
-	getTermSettings(0, (void *) &initial_settings);
-	/* Happens when e.g. stty -echo was run before */
-	if (!(initial_settings.c_lflag & ECHO)) {
+	if (getTermSettings(0, (void *) &initial_settings) < 0
+	 /* Happens when e.g. stty -echo was run before */
+	 || !(initial_settings.c_lflag & ECHO)
+	) {
 		parse_prompt(prompt);
 		fflush(stdout);
 		fgets(command, maxsize, stdin);
