aboutsummaryrefslogtreecommitdiff
path: root/miscutils/devfsd.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /miscutils/devfsd.c
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-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.c26
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;
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"