diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-12 20:58:27 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-12 20:58:27 +0000 |
commit | 6ca409e0e4c198fe3081346eebbae3f068fe605a (patch) | |
tree | 060cb05d99220a1eda399194d1209c269f0e8cd8 /miscutils/devfsd.c | |
parent | 4185548984357df91311f30c8e43d95f33922576 (diff) | |
download | busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2 busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip |
trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount
of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts
size saving: 0.5k
Diffstat (limited to 'miscutils/devfsd.c')
-rw-r--r-- | miscutils/devfsd.c | 26 |
1 files changed, 11 insertions, 15 deletions
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; | |||
245 | static char *mount_point = NULL; | 245 | static char *mount_point = NULL; |
246 | static volatile int caught_signal = FALSE; | 246 | static volatile int caught_signal = FALSE; |
247 | static volatile int caught_sighup = FALSE; | 247 | static volatile int caught_sighup = FALSE; |
248 | static struct initial_symlink_struct | 248 | static 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 | ||
261 | static struct event_type | 259 | static 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 | ||
280 | static const char * const bb_msg_proto_rev = "protocol revision"; | 276 | static const char bb_msg_proto_rev[] ALIGN1 = "protocol revision"; |
281 | static const char * const bb_msg_bad_config = "bad %s config file: %s"; | 277 | static const char bb_msg_bad_config[] ALIGN1 = "bad %s config file: %s"; |
282 | static const char * const bb_msg_small_buffer = "buffer too small"; | 278 | static const char bb_msg_small_buffer[] ALIGN1 = "buffer too small"; |
283 | static const char * const bb_msg_variable_not_found = "variable: %s not found"; | 279 | static 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" |