aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/adjtimex.c13
-rw-r--r--miscutils/devfsd.c26
-rw-r--r--miscutils/hdparm.c19
-rw-r--r--miscutils/less.c4
-rw-r--r--miscutils/time.c6
5 files changed, 36 insertions, 32 deletions
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index 9f8227cf0..1e6d15fa7 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -14,7 +14,10 @@
14#include "libbb.h" 14#include "libbb.h"
15#include <sys/timex.h> 15#include <sys/timex.h>
16 16
17static const struct {int bit; const char *name;} statlist[] = { 17static const struct {
18 int bit;
19 const char *name;
20} statlist[] = {
18 { STA_PLL, "PLL" }, 21 { STA_PLL, "PLL" },
19 { STA_PPSFREQ, "PPSFREQ" }, 22 { STA_PPSFREQ, "PPSFREQ" },
20 { STA_PPSTIME, "PPSTIME" }, 23 { STA_PPSTIME, "PPSTIME" },
@@ -28,15 +31,17 @@ static const struct {int bit; const char *name;} statlist[] = {
28 { STA_PPSWANDER, "PPSWANDER" }, 31 { STA_PPSWANDER, "PPSWANDER" },
29 { STA_PPSERROR, "PPSERROR" }, 32 { STA_PPSERROR, "PPSERROR" },
30 { STA_CLOCKERR, "CLOCKERR" }, 33 { STA_CLOCKERR, "CLOCKERR" },
31 { 0, NULL } }; 34 { 0, NULL }
35};
32 36
33static const char * const ret_code_descript[] = { 37static const char *const ret_code_descript[] = {
34 "clock synchronized", 38 "clock synchronized",
35 "insert leap second", 39 "insert leap second",
36 "delete leap second", 40 "delete leap second",
37 "leap second in progress", 41 "leap second in progress",
38 "leap second has occurred", 42 "leap second has occurred",
39 "clock not synchronized" }; 43 "clock not synchronized"
44};
40 45
41int adjtimex_main(int argc, char **argv); 46int adjtimex_main(int argc, char **argv);
42int adjtimex_main(int argc, char **argv) 47int adjtimex_main(int argc, char **argv)
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c
index 848f2b3ea..6b31f368a 100644
--- a/miscutils/devfsd.c
+++ b/miscutils/devfsd.c
@@ -245,12 +245,10 @@ static struct config_entry_struct *last_config = NULL;
245static char *mount_point = NULL; 245static char *mount_point = NULL;
246static volatile int caught_signal = FALSE; 246static volatile int caught_signal = FALSE;
247static volatile int caught_sighup = FALSE; 247static volatile int caught_sighup = FALSE;
248static struct initial_symlink_struct 248static struct initial_symlink_struct {
249{
250 const char *dest; 249 const char *dest;
251 const char *name; 250 const char *name;
252} initial_symlinks[] = 251} initial_symlinks[] = {
253{
254 {"/proc/self/fd", "fd"}, 252 {"/proc/self/fd", "fd"},
255 {"fd/0", "stdin"}, 253 {"fd/0", "stdin"},
256 {"fd/1", "stdout"}, 254 {"fd/1", "stdout"},
@@ -258,12 +256,10 @@ static struct initial_symlink_struct
258 {NULL, NULL}, 256 {NULL, NULL},
259}; 257};
260 258
261static struct event_type 259static struct event_type {
262{
263 unsigned int type; /* The DEVFSD_NOTIFY_* value */ 260 unsigned int type; /* The DEVFSD_NOTIFY_* value */
264 const char *config_name; /* The name used in the config file */ 261 const char *config_name; /* The name used in the config file */
265} event_types[] = 262} event_types[] = {
266{
267 {DEVFSD_NOTIFY_REGISTERED, "REGISTER"}, 263 {DEVFSD_NOTIFY_REGISTERED, "REGISTER"},
268 {DEVFSD_NOTIFY_UNREGISTERED, "UNREGISTER"}, 264 {DEVFSD_NOTIFY_UNREGISTERED, "UNREGISTER"},
269 {DEVFSD_NOTIFY_ASYNC_OPEN, "ASYNC_OPEN"}, 265 {DEVFSD_NOTIFY_ASYNC_OPEN, "ASYNC_OPEN"},
@@ -277,10 +273,10 @@ static struct event_type
277 273
278/* Busybox messages */ 274/* Busybox messages */
279 275
280static const char * const bb_msg_proto_rev = "protocol revision"; 276static const char bb_msg_proto_rev[] ALIGN1 = "protocol revision";
281static const char * const bb_msg_bad_config = "bad %s config file: %s"; 277static const char bb_msg_bad_config[] ALIGN1 = "bad %s config file: %s";
282static const char * const bb_msg_small_buffer = "buffer too small"; 278static const char bb_msg_small_buffer[] ALIGN1 = "buffer too small";
283static const char * const bb_msg_variable_not_found = "variable: %s not found"; 279static const char bb_msg_variable_not_found[] ALIGN1 = "variable: %s not found";
284 280
285/* Busybox stuff */ 281/* Busybox stuff */
286#if ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG 282#if ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG
@@ -387,10 +383,10 @@ int devfsd_main(int argc, char **argv)
387 383
388 /* NB: The check for CONFIG_FILE is done in read_config_file() */ 384 /* NB: The check for CONFIG_FILE is done in read_config_file() */
389 385
390 if (print_version ||(DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)) { 386 if (print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)) {
391 printf("%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n", 387 printf("%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n",
392 applet_name, DEVFSD_VERSION, bb_msg_proto_rev, 388 applet_name, DEVFSD_VERSION, bb_msg_proto_rev,
393 DEVFSD_PROTOCOL_REVISION_DAEMON,bb_msg_proto_rev, proto_rev); 389 DEVFSD_PROTOCOL_REVISION_DAEMON, bb_msg_proto_rev, proto_rev);
394 if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) 390 if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)
395 bb_error_msg_and_die("%s mismatch!", bb_msg_proto_rev); 391 bb_error_msg_and_die("%s mismatch!", bb_msg_proto_rev);
396 exit(EXIT_SUCCESS); /* -v */ 392 exit(EXIT_SUCCESS); /* -v */
@@ -509,7 +505,7 @@ static void process_config_line(const char *line, unsigned long *event_mask)
509 int i; 505 int i;
510 506
511 /* !!!! Only Uppercase Keywords in devsfd.conf */ 507 /* !!!! Only Uppercase Keywords in devsfd.conf */
512 static const char options[] = 508 static const char options[] ALIGN1 =
513 "CLEAR_CONFIG\0""INCLUDE\0""OPTIONAL_INCLUDE\0" 509 "CLEAR_CONFIG\0""INCLUDE\0""OPTIONAL_INCLUDE\0"
514 "RESTORE\0""PERMISSIONS\0""MODLOAD\0""EXECUTE\0" 510 "RESTORE\0""PERMISSIONS\0""MODLOAD\0""EXECUTE\0"
515 "COPY\0""IGNORE\0""MKOLDCOMPAT\0""MKNEWCOMPAT\0" 511 "COPY\0""IGNORE\0""MKOLDCOMPAT\0""MKNEWCOMPAT\0"
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 98cc04fd3..484c97061 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -128,7 +128,7 @@
128#define CDROM 0x0005 128#define CDROM 0x0005
129 129
130#if ENABLE_FEATURE_HDPARM_GET_IDENTITY 130#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
131static const char * const pkt_str[] = { 131static const char *const pkt_str[] = {
132 "Direct-access device", /* word 0, bits 12-8 = 00 */ 132 "Direct-access device", /* word 0, bits 12-8 = 00 */
133 "Sequential-access device", /* word 0, bits 12-8 = 01 */ 133 "Sequential-access device", /* word 0, bits 12-8 = 01 */
134 "Printer", /* word 0, bits 12-8 = 02 */ 134 "Printer", /* word 0, bits 12-8 = 02 */
@@ -163,7 +163,7 @@ static const char * const pkt_str[] = {
163 "Unknown", /* word 0, bits 12-8 = 1f */ 163 "Unknown", /* word 0, bits 12-8 = 1f */
164}; 164};
165 165
166static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */ 166static const char *const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
167 "Reserved", /* bit 0 */ 167 "Reserved", /* bit 0 */
168 "hard sectored", /* bit 1 */ 168 "hard sectored", /* bit 1 */
169 "soft sectored", /* bit 2 */ 169 "soft sectored", /* bit 2 */
@@ -326,7 +326,7 @@ static const char actual_ver[MINOR_MAX+2] = {
326#define NUM_CMD_FEAT_STR 48 326#define NUM_CMD_FEAT_STR 48
327 327
328#if ENABLE_FEATURE_HDPARM_GET_IDENTITY 328#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
329static const char * const cmd_feat_str[] = { 329static const char *const cmd_feat_str[] = {
330 "", /* word 82 bit 15: obsolete */ 330 "", /* word 82 bit 15: obsolete */
331 "NOP cmd", /* word 82 bit 14 */ 331 "NOP cmd", /* word 82 bit 14 */
332 "READ BUFFER cmd", /* word 82 bit 13 */ 332 "READ BUFFER cmd", /* word 82 bit 13 */
@@ -413,7 +413,7 @@ void identify_from_stdin(void);
413#define SECU_LEVEL 0x0010 413#define SECU_LEVEL 0x0010
414#define NUM_SECU_STR 6 414#define NUM_SECU_STR 6
415#if ENABLE_FEATURE_HDPARM_GET_IDENTITY 415#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
416static const char * const secu_str[] = { 416static const char *const secu_str[] = {
417 "supported", /* word 128, bit 0 */ 417 "supported", /* word 128, bit 0 */
418 "enabled", /* word 128, bit 1 */ 418 "enabled", /* word 128, bit 1 */
419 "locked", /* word 128, bit 2 */ 419 "locked", /* word 128, bit 2 */
@@ -1096,14 +1096,16 @@ static unsigned long hwif_irq;
1096// Too bad, really. 1096// Too bad, really.
1097 1097
1098#if ENABLE_FEATURE_HDPARM_GET_IDENTITY 1098#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
1099static const char * const cfg_str[] = 1099static const char *const cfg_str[] = {
1100{ "", "HardSect", "SoftSect", "NotMFM", 1100 "", "HardSect", "SoftSect", "NotMFM",
1101 "HdSw>15uSec", "SpinMotCtl", "Fixed", "Removeable", 1101 "HdSw>15uSec", "SpinMotCtl", "Fixed", "Removeable",
1102 "DTR<=5Mbs", "DTR>5Mbs", "DTR>10Mbs", "RotSpdTol>.5%", 1102 "DTR<=5Mbs", "DTR>5Mbs", "DTR>10Mbs", "RotSpdTol>.5%",
1103 "dStbOff", "TrkOff", "FmtGapReq", "nonMagnetic" 1103 "dStbOff", "TrkOff", "FmtGapReq", "nonMagnetic"
1104}; 1104};
1105 1105
1106static const char * const BuffType[] = {"Unknown", "1Sect", "DualPort", "DualPortCache"}; 1106static const char *const BuffType[] = {
1107 "Unknown", "1Sect", "DualPort", "DualPortCache"
1108};
1107 1109
1108static void dump_identity(const struct hd_driveid *id) 1110static void dump_identity(const struct hd_driveid *id)
1109{ 1111{
@@ -1930,7 +1932,8 @@ static void parse_xfermode(int flag, smallint *get, smallint *set, int *value)
1930} 1932}
1931 1933
1932/*------- getopt short options --------*/ 1934/*------- getopt short options --------*/
1933static const char hdparm_options[] = "gfu::n::p:r::m::c::k::a::B:tTh" 1935static const char hdparm_options[] ALIGN1 =
1936 "gfu::n::p:r::m::c::k::a::B:tTh"
1934 USE_FEATURE_HDPARM_GET_IDENTITY("iI") 1937 USE_FEATURE_HDPARM_GET_IDENTITY("iI")
1935 USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::") 1938 USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::")
1936#ifdef HDIO_DRIVE_CMD 1939#ifdef HDIO_DRIVE_CMD
diff --git a/miscutils/less.c b/miscutils/less.c
index a6649c5ca..046a3c459 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -450,12 +450,12 @@ static void cap_cur_fline(int nlines)
450 } 450 }
451} 451}
452 452
453static const char controls[] = 453static const char controls[] ALIGN1 =
454 /* NUL: never encountered; TAB: not converted */ 454 /* NUL: never encountered; TAB: not converted */
455 /**/"\x01\x02\x03\x04\x05\x06\x07\x08" "\x0a\x0b\x0c\x0d\x0e\x0f" 455 /**/"\x01\x02\x03\x04\x05\x06\x07\x08" "\x0a\x0b\x0c\x0d\x0e\x0f"
456 "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" 456 "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
457 "\x7f\x9b"; /* DEL and infamous Meta-ESC :( */ 457 "\x7f\x9b"; /* DEL and infamous Meta-ESC :( */
458static const char ctrlconv[] = 458static const char ctrlconv[] ALIGN1 =
459 /* '\n': it's a former NUL - subst with '@', not 'J' */ 459 /* '\n': it's a former NUL - subst with '@', not 'J' */
460 "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f" 460 "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f"
461 "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"; 461 "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f";
diff --git a/miscutils/time.c b/miscutils/time.c
index 9b7db662a..e8473f702 100644
--- a/miscutils/time.c
+++ b/miscutils/time.c
@@ -23,15 +23,15 @@ typedef struct {
23 23
24#define UL unsigned long 24#define UL unsigned long
25 25
26static const char default_format[] = "real\t%E\nuser\t%u\nsys\t%T"; 26static const char default_format[] ALIGN1 = "real\t%E\nuser\t%u\nsys\t%T";
27 27
28/* The output format for the -p option .*/ 28/* The output format for the -p option .*/
29static const char posix_format[] = "real %e\nuser %U\nsys %S"; 29static const char posix_format[] ALIGN1 = "real %e\nuser %U\nsys %S";
30 30
31 31
32/* Format string for printing all statistics verbosely. 32/* Format string for printing all statistics verbosely.
33 Keep this output to 24 lines so users on terminals can see it all.*/ 33 Keep this output to 24 lines so users on terminals can see it all.*/
34static const char long_format[] = 34static const char long_format[] ALIGN1 =
35 "\tCommand being timed: \"%C\"\n" 35 "\tCommand being timed: \"%C\"\n"
36 "\tUser time (seconds): %U\n" 36 "\tUser time (seconds): %U\n"
37 "\tSystem time (seconds): %S\n" 37 "\tSystem time (seconds): %S\n"