busybox stty -echo

Paul Albrecht albrecht at rdi1.com
Mon Jan 15 06:14:20 PST 2007


On Sun, 2007-01-14 at 16:31 +0100, Bernhard Fischer wrote: 
> On Fri, Jan 12, 2007 at 04:46:33PM -0500, Paul Albrecht wrote:
> >
> >I typedef'ed int to smallint at the start of stty_main and the applet
> >compiled cleanly.
> >
> >I tested "busybox stty -echo" with the updated busybox and it worked,
> >that is, echoing was turned off, so your fix works for me.
> >
> >Thanks!
> 
> Paul, all,
> 
> May i ask you to test the attached patches?
> 
> They were only compile tested but shouldn't do much harm, except,
> perhaps the busybox.stty-01g-shrinkage.diff
> 
> statistics:
>    text	   data	    bss	    dec	    hex	filename
>    6714	      8	     14	   6736	   1a50	stty.o.orig
>    6599	      8	     14	   6621	   19dd	stty.o.01b
>    6599	      8	     14	   6621	   19dd	stty.o.01c
>    6599	      8	     14	   6621	   19dd	stty.o.01d
>    6517	      8	     14	   6539	   198b	stty.o.01e
>    6462	      8	     14	   6484	   1954	stty.o.01f
>    6203	      8	     14	   6225	   1851	stty.o.01g
>    6197	      8	     14	   6219	   184b	stty.o.01h
>    6197	      8	     14	   6219	   184b	stty.o.01i
> 
> ChangeLog:
> 
> busybox.stty-01b-shrinkage.diff:
> - reuse option_mask32 for state-handling in main
> - improve check for errors from fcntl
> 
> 
> busybox.stty-01c-shrinkage.diff:
> - constify some read-only members and remove superfluous casts
>   (cleanup)
> 
> busybox.stty-01d-shrinkage.diff:
> - manually inline tty_value_to_baud and remove string_to_baud_or_die
>   (cleanup)
> 
> busybox.stty-01e-shrinkage.diff:
> - rewrite find_param to use index_in_str_array
> 
> busybox.stty-01f-shrinkage.diff:
> - peruse get_terminal_width_height and remove legacy code for ancient
>   slowaris versions.
> 
> busybox.stty-01g-shrinkage.diff:
> - merge display_changed() and display_all()
> 
> busybox.stty-01h-shrinkage.diff:
> - reuse return code of vsnprintf to avoid pulling in strlen
> 
> busybox.stty-01i-shrinkage.diff:
> - remove superfluous define that expanded to "!strcmp"
> - remove some dead code
> 
> 
> I will apply these patches to trunk in about a week unless somebody objects.
> 

I tried applying the first patch and it failed. Here's the output:

cd busybox-1.3.0
patch -p0 < ../busybox.stty-01b-shrinkage.diff

patching file coreutils/stty.c
Hunk #1 succeeded at 644 with fuzz 2 (offset -370 lines).
Hunk #3 succeeded at 681 (offset -370 lines).
Hunk #5 succeeded at 712 (offset -370 lines).
Hunk #7 succeeded at 762 (offset -370 lines).
Hunk #9 succeeded at 798 (offset -370 lines).
Hunk #10 FAILED at 817.
Hunk #11 FAILED at 826.
Hunk #12 FAILED at 834.
Hunk #13 succeeded at 1214 (offset -3 lines).
Hunk #14 succeeded at 866 (offset -370 lines).
Hunk #15 succeeded at 1281 (offset -3 lines).
3 out of 15 hunks FAILED -- saving rejects to file coreutils/stty.c.rej

You should be able to verify your code by simply running the stty
applet:

busybox stty -echo

If the fix works echo'ing will be turned off. 


More information about the busybox mailing list