diff options
Diffstat (limited to 'miscutils/devfsd.c')
-rw-r--r-- | miscutils/devfsd.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 5435a6a0b..7c604f604 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c | |||
@@ -242,7 +242,7 @@ static const char *expand_variable( char *, unsigned, unsigned *, const char *, | |||
242 | const char *(*) (const char *, void *), void * ); | 242 | const char *(*) (const char *, void *), void * ); |
243 | static const char *get_variable_v2(const char *, const char *(*) (const char *, void *), void *); | 243 | static const char *get_variable_v2(const char *, const char *(*) (const char *, void *), void *); |
244 | static char get_old_ide_name (unsigned , unsigned); | 244 | static char get_old_ide_name (unsigned , unsigned); |
245 | static char *write_old_sd_name (char *, unsigned, unsigned, char *); | 245 | static char *write_old_sd_name (char *, unsigned, unsigned, const char *); |
246 | 246 | ||
247 | /* busybox functions */ | 247 | /* busybox functions */ |
248 | static void msg_logger(int pri, const char * fmt, ... )__attribute__ ((format (printf, 2, 3))); | 248 | static void msg_logger(int pri, const char * fmt, ... )__attribute__ ((format (printf, 2, 3))); |
@@ -262,8 +262,8 @@ static volatile int caught_signal = FALSE; | |||
262 | static volatile int caught_sighup = FALSE; | 262 | static volatile int caught_sighup = FALSE; |
263 | static struct initial_symlink_struct | 263 | static struct initial_symlink_struct |
264 | { | 264 | { |
265 | char *dest; | 265 | const char *dest; |
266 | char *name; | 266 | const char *name; |
267 | } initial_symlinks[] = | 267 | } initial_symlinks[] = |
268 | { | 268 | { |
269 | {"/proc/self/fd", "fd"}, | 269 | {"/proc/self/fd", "fd"}, |
@@ -479,9 +479,8 @@ int devfsd_main (int argc, char **argv) | |||
479 | 479 | ||
480 | /* NB: The check for CONFIG_FILE is done in read_config_file() */ | 480 | /* NB: The check for CONFIG_FILE is done in read_config_file() */ |
481 | 481 | ||
482 | if ( print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) ) | 482 | if (print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)) { |
483 | { | 483 | printf("%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n", |
484 | printf( "%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n", | ||
485 | applet_name,DEVFSD_VERSION,bb_msg_proto_rev, | 484 | applet_name,DEVFSD_VERSION,bb_msg_proto_rev, |
486 | DEVFSD_PROTOCOL_REVISION_DAEMON,bb_msg_proto_rev, proto_rev); | 485 | DEVFSD_PROTOCOL_REVISION_DAEMON,bb_msg_proto_rev, proto_rev); |
487 | if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) | 486 | if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) |
@@ -491,19 +490,19 @@ int devfsd_main (int argc, char **argv) | |||
491 | /* Tell kernel we are special (i.e. we get to see hidden entries) */ | 490 | /* Tell kernel we are special (i.e. we get to see hidden entries) */ |
492 | do_ioctl_and_die(fd, DEVFSDIOC_SET_EVENT_MASK, 0); | 491 | do_ioctl_and_die(fd, DEVFSDIOC_SET_EVENT_MASK, 0); |
493 | 492 | ||
494 | sigemptyset (&new_action.sa_mask); | 493 | sigemptyset(&new_action.sa_mask); |
495 | new_action.sa_flags = 0; | 494 | new_action.sa_flags = 0; |
496 | 495 | ||
497 | /* Set up SIGHUP and SIGUSR1 handlers */ | 496 | /* Set up SIGHUP and SIGUSR1 handlers */ |
498 | new_action.sa_handler = signal_handler; | 497 | new_action.sa_handler = signal_handler; |
499 | if (sigaction (SIGHUP, &new_action, NULL) != 0 || sigaction (SIGUSR1, &new_action, NULL) != 0 ) | 498 | if (sigaction(SIGHUP, &new_action, NULL) != 0 || sigaction (SIGUSR1, &new_action, NULL) != 0 ) |
500 | devfsd_error_msg_and_die( "sigaction"); | 499 | devfsd_error_msg_and_die( "sigaction"); |
501 | 500 | ||
502 | printf("%s v%s started for %s\n",applet_name, DEVFSD_VERSION, mount_point); | 501 | printf("%s v%s started for %s\n",applet_name, DEVFSD_VERSION, mount_point); |
503 | 502 | ||
504 | /* Set umask so that mknod(2), open(2) and mkdir(2) have complete control over permissions */ | 503 | /* Set umask so that mknod(2), open(2) and mkdir(2) have complete control over permissions */ |
505 | umask (0); | 504 | umask(0); |
506 | read_config_file (CONFIG_FILE, FALSE, &event_mask); | 505 | read_config_file((char*)CONFIG_FILE, FALSE, &event_mask); |
507 | /* Do the scan before forking, so that boot scripts see the finished product */ | 506 | /* Do the scan before forking, so that boot scripts see the finished product */ |
508 | dir_operation(SERVICE,mount_point,0,NULL); | 507 | dir_operation(SERVICE,mount_point,0,NULL); |
509 | 508 | ||
@@ -524,7 +523,7 @@ int devfsd_main (int argc, char **argv) | |||
524 | do_scan = do_servicing (fd, event_mask); | 523 | do_scan = do_servicing (fd, event_mask); |
525 | 524 | ||
526 | free_config (); | 525 | free_config (); |
527 | read_config_file (CONFIG_FILE, FALSE, &event_mask); | 526 | read_config_file ((char*)CONFIG_FILE, FALSE, &event_mask); |
528 | if (do_scan) | 527 | if (do_scan) |
529 | dir_operation(SERVICE,mount_point,0,NULL); | 528 | dir_operation(SERVICE,mount_point,0,NULL); |
530 | } | 529 | } |
@@ -545,7 +544,7 @@ static void read_config_file (char *path, int optional, unsigned long *event_mas | |||
545 | struct stat statbuf; | 544 | struct stat statbuf; |
546 | FILE *fp; | 545 | FILE *fp; |
547 | char buf[STRING_LENGTH]; | 546 | char buf[STRING_LENGTH]; |
548 | char *line=NULL; | 547 | char *line = NULL; |
549 | 548 | ||
550 | debug_msg_logger(LOG_INFO, "%s: %s", __FUNCTION__, path); | 549 | debug_msg_logger(LOG_INFO, "%s: %s", __FUNCTION__, path); |
551 | 550 | ||
@@ -598,7 +597,7 @@ static void process_config_line (const char *line, unsigned long *event_mask) | |||
598 | char p[MAX_ARGS][STRING_LENGTH]; | 597 | char p[MAX_ARGS][STRING_LENGTH]; |
599 | char when[STRING_LENGTH], what[STRING_LENGTH]; | 598 | char when[STRING_LENGTH], what[STRING_LENGTH]; |
600 | char name[STRING_LENGTH]; | 599 | char name[STRING_LENGTH]; |
601 | char * msg=""; | 600 | const char *msg = ""; |
602 | char *ptr; | 601 | char *ptr; |
603 | int i; | 602 | int i; |
604 | 603 | ||
@@ -876,10 +875,10 @@ static void action_modload (const struct devfsd_notify_struct *info, | |||
876 | char *argv[6]; | 875 | char *argv[6]; |
877 | char device[STRING_LENGTH]; | 876 | char device[STRING_LENGTH]; |
878 | 877 | ||
879 | argv[0] = MODPROBE; | 878 | argv[0] = (char*)MODPROBE; |
880 | argv[1] = MODPROBE_SWITCH_1; /* "-k" */ | 879 | argv[1] = (char*)MODPROBE_SWITCH_1; /* "-k" */ |
881 | argv[2] = MODPROBE_SWITCH_2; /* "-C" */ | 880 | argv[2] = (char*)MODPROBE_SWITCH_2; /* "-C" */ |
882 | argv[3] = CONFIG_MODULES_DEVFS; | 881 | argv[3] = (char*)CONFIG_MODULES_DEVFS; |
883 | argv[4] = device; | 882 | argv[4] = device; |
884 | argv[5] = NULL; | 883 | argv[5] = NULL; |
885 | 884 | ||
@@ -1221,7 +1220,7 @@ static int get_uid_gid (int flag, const char *string) | |||
1221 | { | 1220 | { |
1222 | struct passwd *pw_ent; | 1221 | struct passwd *pw_ent; |
1223 | struct group *grp_ent; | 1222 | struct group *grp_ent; |
1224 | static char *msg; | 1223 | static const char *msg; |
1225 | 1224 | ||
1226 | if (ENABLE_DEVFSD_VERBOSE) | 1225 | if (ENABLE_DEVFSD_VERBOSE) |
1227 | msg="user"; | 1226 | msg="user"; |
@@ -1532,8 +1531,8 @@ static void expand_regexp (char *output, size_t outsize, const char *input, | |||
1532 | 1531 | ||
1533 | struct translate_struct | 1532 | struct translate_struct |
1534 | { | 1533 | { |
1535 | char *match; /* The string to match to (up to length) */ | 1534 | const char *match; /* The string to match to (up to length) */ |
1536 | char *format; /* Format of output, "%s" takes data past match string, | 1535 | const char *format; /* Format of output, "%s" takes data past match string, |
1537 | NULL is effectively "%s" (just more efficient) */ | 1536 | NULL is effectively "%s" (just more efficient) */ |
1538 | }; | 1537 | }; |
1539 | 1538 | ||
@@ -1719,7 +1718,7 @@ static char get_old_ide_name (unsigned int major, unsigned int minor) | |||
1719 | 1718 | ||
1720 | static char *write_old_sd_name (char *buffer, | 1719 | static char *write_old_sd_name (char *buffer, |
1721 | unsigned int major, unsigned int minor, | 1720 | unsigned int major, unsigned int minor, |
1722 | char *part) | 1721 | const char *part) |
1723 | /* [SUMMARY] Write the old SCSI disc name to a buffer. | 1722 | /* [SUMMARY] Write the old SCSI disc name to a buffer. |
1724 | <buffer> The buffer to write to. | 1723 | <buffer> The buffer to write to. |
1725 | <major> The major number for the device. | 1724 | <major> The major number for the device. |