Commit Graph

1051 Commits

Author SHA1 Message Date
Denys Vlasenko
5b3cbe3a53 config: more tweaking of help texts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-27 14:45:25 +02:00
Denys Vlasenko
68b653b66b config: trim/improve item names and help texts, take 2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-27 10:53:09 +02:00
Denys Vlasenko
bbf17bbf32 crond: do not assume setenv() does not leak
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-22 02:25:47 +02:00
Denys Vlasenko
c9e7843dde crond: allow $SHELL and starting user's shell override DEFAULT_SHELL. Closes 6458
function                                             old     new   delta
crond_main                                          1134    1149     +15
fork_job                                             453     454      +1

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-22 01:47:19 +02:00
Denys Vlasenko
72089cf6b4 config: deindent all help texts
Those two spaces after tab have no effect, and always a nuisance when editing.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-21 09:50:55 +02:00
Denys Vlasenko
ae178cee3d Update remaining menuconfig items with approximate applet sizes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-19 14:32:54 +02:00
Denys Vlasenko
9880f86d6e hdparm: remove contradicting size info in config help
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-18 22:25:58 +02:00
Denys Vlasenko
4eed2c6c50 Update menuconfig items with approximate applet sizes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-18 22:01:24 +02:00
Denys Vlasenko
68e980545a ttysize: if stdin is not tty, try stdout, then stderr
function                                             old     new   delta
ttysize_main                                         135     175     +40
packed_usage                                       31686   31672     -14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-16 20:36:48 +02:00
Denys Vlasenko
d18b200096 crond: code shrink
function                                             old     new   delta
load_crontab                                         936     925     -11

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-09 00:08:13 +02:00
Denys Vlasenko
0b3b65fa91 crond: move misplaced comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-09 00:00:39 +02:00
Denys Vlasenko
75fbea3879 crond: support @daily etc
function                                             old     new   delta
start_jobs                                             -     348    +348
load_crontab                                         766     936    +170
static.SpecAry                                         -      96     +96
crond_main                                          1424    1134    -290
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/1 up/down: 614/-290)          Total: 324 bytes

Based on patch by Jonathan Kolb <kolbyjack@gmail.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-08 20:53:11 +02:00
Denys Vlasenko
1572f520cc watchdog: do not use argc, other cleanups
function                                             old     new   delta
watchdog_main                                        298     291      -7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-08 18:53:49 +02:00
Matt Spinler
31c765081d watchdog: stop watchdog first on startup
Some watchdog implementations may do things other than issue
a reboot on a watchdog timeout.  In this case, there's the
possibility of restarting this program from the state of
the watchdog device not being properly stopped (done by writing
a 'V' and closing the device).  Since it wasn't stopped, the
driver may not be able to restart the watchdog when this program
reopens it and starts pinging it.

To fix this, the code will always first issue the stop when it
starts up.

function                                             old     new   delta
shutdown_on_signal                                     -      32     +32
watchdog_main                                        268     298     +30
shutdown_watchdog                                      -      25     +25
watchdog_shutdown                                     41       -     -41
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 1/0 up/down: 87/-41)             Total: 46 bytes

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-08 18:35:25 +02:00
Denys Vlasenko
1b84f4a22a beep: disallow FEATURE_BEEP_FREQ = 0 in configuration
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-08 12:21:45 +02:00
Denys Vlasenko
3c9688e587 makedevs: code shrink
function                                             old     new   delta
makedevs_main                                       1071    1052     -19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-06 02:17:24 +02:00
Denys Vlasenko
3532e60ca8 makedevs: allow much longer filenames
function                                             old     new   delta
makedevs_main                                       1056    1071     +15

Patch by Kang-Che Sung <explorer09@gmail.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-06 02:04:32 +02:00
Denys Vlasenko
a1a3b595e1 time: inplement -f FMT
function                                             old     new   delta
time_main                                           1076    1134     +58
packed_usage                                       31577   31572      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-28 18:01:18 +02:00
Tommi Rantala
5fe5be210c time: implement -a, -o FILE
function                                             old     new   delta
time_main                                           1052    1076     +24
packed_usage                                       31571   31577      +6

Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-28 17:54:14 +02:00
Tommi Rantala
854174f7dd time: document -p in usage
Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-28 17:34:32 +02:00
Markus Gothe
9c7ee1439a lsscsi: new applet
function                                             old     new   delta
lsscsi_main                                            -     326    +326
applet_names                                        2613    2620      +7
applet_main                                         1512    1516      +4
applet_install_loc                                   189     190      +1
packed_usage                                       31566   31560      -6
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/1 up/down: 338/-6)            Total: 332 bytes

Signed-off-by: Markus Gothe <nietzsche@lysator.liu.se>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-18 19:26:26 +02:00
Denys Vlasenko
10ad622dc2 Spelling fixes in comments, documentation, tests and examples
By klemens <ka7@github.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-17 16:13:32 +02:00
Denys Vlasenko
783d57af7b Sort some miscutils/ applets into coreutils or util-linux
No code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-12 13:58:40 +02:00
Denys Vlasenko
ac47a00e2e partprobe: new applet
function                                             old     new   delta
partprobe_main                                         -      79     +79
packed_usage                                       31485   31511     +26
applet_names                                        2608    2618     +10
applet_main                                         1512    1516      +4
applet_install_loc                                   189     190      +1
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 4/0 up/down: 120/0)             Total: 120 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-11 19:17:59 +02:00
Rostislav Skudnov
8762512fdb Replace int -> uint to avoid signed integer overflow
An example of such an error (should be compiled with DEBUG_SANITIZE):

runtime error: left shift of 1 by 31 places cannot be represented in
type 'int'

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-02-04 23:10:22 +01:00
Denys Vlasenko
d6ace66973 taskset: simplify code a bit; tweak --help
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-30 22:20:06 +01:00
Denys Vlasenko
86663910ba taskset: separate "current" and "new" strings
Better for constant sharing:

   text	   data	    bss	    dec	    hex	filename
 912997	    485	   6856	 920338	  e0b12	busybox_old
 912988	    485	   6856	 920329	  e0b09	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-29 18:59:38 +01:00
Denys Vlasenko
ef0e76cc27 taskset: rewrite to be task size-agnostic
function                                             old     new   delta
packed_usage                                       31130   31190     +60
taskset_main                                         623     525     -98
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 60/-98)            Total: -38 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-29 18:19:29 +01:00
Denys Vlasenko
205d48e948 *: add comment about APPLET_ODDNAME format
It confused me more than once

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-29 14:57:33 +01:00
Denys Vlasenko
f3d705f41b make --help texts smaller
function                                             old     new   delta
packed_usage                                       31035   30968     -67

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-21 03:46:57 +01:00
Denys Vlasenko
bbc7bee966 make --help texts more uniform
function                                             old     new   delta
packed_usage                                       31062   31035     -27

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-21 02:49:58 +01:00
Denys Vlasenko
01ccdd1d3c libbb: consolidate the code to set termios unbuffered mode
function                                             old     new   delta
set_termios_to_raw                                     -     116    +116
count_lines                                           72      74      +2
powertop_main                                       1458    1430     -28
top_main                                             943     914     -29
more_main                                            759     714     -45
fsck_minix_main                                     2969    2921     -48
conspy_main                                         1197    1135     -62
rawmode                                               99      36     -63
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/6 up/down: 118/-275)         Total: -157 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-11 16:17:59 +01:00
Denys Vlasenko
f560422fa0 Big cleanup in config help and description
Redundant help texts (one which only repeats the description)
are deleted.

Descriptions and help texts are trimmed.

Some config options are moved, even across menus.

No config option _names_ are changed.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-10 14:58:54 +01:00
Denys Vlasenko
1d3a04a3a4 Code style fixes, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-28 01:22:57 +01:00
Denys Vlasenko
2c769c69b2 makedevs: make special node creation idempotent
When makedevs is called for a second time with the same device file,
it fails because the files already exist and mknod() gives -EEXIST.

Ignore EEXIST errors.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-27 23:27:54 +01:00
Denys Vlasenko
e5dd71f94f Remove trailing empty lines
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-23 10:43:39 +01:00
Denys Vlasenko
f88e3bfa8d Convert all miscutils/* applets to "new style" applet definitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-22 23:54:17 +01:00
Denys Vlasenko
fb4da16711 Split miscutils/Config.src items into miscutils/*.c files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-22 23:14:24 +01:00
Denys Vlasenko
2e6af54971 man: remove -Tascii from nroff invocation
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-10-31 14:05:34 +01:00
Denys Vlasenko
7c3c92c533 man: make width selection more thorough; explain how to override it
Fedora's "man CMD >file" still uses terminal width, not 80 (but disables formatting),
this change mimics that.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-10-31 01:52:18 +01:00
Denys Vlasenko
a92a74961d man: allow nroff and tbl commands be overridden; unmangle writing to files
Parse this in config files:
	 DEFINE col ...
	 DEFINE tbl ...
	 DEFINE nroff ...
Add width options to nroff command line.
Use "tbl", not "gtbl", as default tbl command.
Export GROFF_NO_SGR=1 and use "col -b -p -x" instead of pager when writing to file.

function                                             old     new   delta
man_main                                             735     863    +128
if_redefined                                           -      64     +64
show_manpage                                         199     169     -30
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 192/-30)           Total: 162 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-10-30 22:31:30 +01:00
Tito Ragusa
69312e87b0 strings: implement -t radix
v2: minor code cleanup, no changes.
v1: Implement -t radix option.
    Fix help text for -o option.

Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-10-24 21:52:10 +02:00
Denys Vlasenko
7fa799a97d less: switch off nonblock on kbd_fd before exit
This is only necessary if we use stdout fd.

function                                             old     new   delta
less_exit                                             32      51     +19
less_main                                           2540    2543      +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 22/0)               Total: 22 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-13 21:05:48 +02:00
Denys Vlasenko
3c0e579a06 less: fall back to using fd #1 for keyboard reading. Closes 9231
function                                             old     new   delta
less_main                                           2535    2540      +5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-13 20:53:38 +02:00
Denys Vlasenko
6b76e23454 man: fix parsing of "DEFINE pager xyz". Closes 8976
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-08-22 21:41:05 +02:00
Denys Vlasenko
110c6bb413 less: fix bracket search to match behavior of less 481
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-08-16 15:27:30 +02:00
Denys Vlasenko
252559601f less: fix SEGV
testcase: echo "" | less, then press ')' key

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-08-16 15:09:40 +02:00
Denys Vlasenko
237bedd499 getopt32: add new syntax of 'o:+' and 'o:*' for -o NUM and -o LIST
In many cases, this aqllows to drop use of opt_complementary.
Approximately -400 bytes:

function                                             old     new   delta
getopt32                                            1423    1502     +79
opt_string                                            17      18      +1
OPT_STR                                               24      25      +1
uniq_main                                            416     406     -10
timeout_main                                         279     269     -10
sulogin_main                                         270     260     -10
readprofile_main                                    1825    1815     -10
ps_main                                              543     533     -10
pidof_main                                           245     235     -10
pgrep_main                                           611     601     -10
od_main                                             2600    2590     -10
mkfs_minix_main                                     2684    2674     -10
mkfs_ext2_main                                      2603    2593     -10
microcom_main                                        712     702     -10
makemime_main                                        315     305     -10
ionice_main                                          282     272     -10
inetd_main                                          2074    2064     -10
ifplugd_main                                        1144    1134     -10
halt_main                                            353     343     -10
getopt_main                                          636     626     -10
fdisk_main                                          2854    2844     -10
env_main                                             206     196     -10
dmesg_main                                           319     309     -10
conspy_main                                         1214    1204     -10
awk_main                                             981     971     -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/22 up/down: 81/-220)         Total: -139 bytes
   text	   data	    bss	    dec	    hex	filename
 919373	    906	  14060	 934339	  e41c3	busybox_old
 918969	    906	  14060	 933935	  e402f	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-07-06 21:58:02 +02:00
Bartosz Golaszewski
59f8197624 i2cdump: don't use common_bufsiz1
Commit e6a2f4cc changed the way common_bufsiz1 works. Now it needs to
be initialized before using, but i2cdump wasn't updated by said patch.

Since the fact that we're using common_bufsiz1 here isn't obvious (no
G_INIT() macro, no other global variables), drop it and simply
allocate the integer array required for block reads on the stack.

Tested with i2c block read on a Lenovo Thinkpad laptop.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-06-24 03:58:43 +02:00
Denys Vlasenko
7cf45ae10e setsid: fix broken -c
This did not work: setsid sh -c 'anything'

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-06-20 23:50:26 +02:00