const char *(*) (const char *, void *), void * );
static const char *get_variable_v2(const char *, const char *(*) (const char *, void *), void *);
static char get_old_ide_name (unsigned , unsigned);
-static char *write_old_sd_name (char *, unsigned, unsigned, char *);
+static char *write_old_sd_name (char *, unsigned, unsigned, const char *);
/* busybox functions */
static void msg_logger(int pri, const char * fmt, ... )__attribute__ ((format (printf, 2, 3)));
static volatile int caught_sighup = FALSE;
static struct initial_symlink_struct
{
- char *dest;
- char *name;
+ const char *dest;
+ const char *name;
} initial_symlinks[] =
{
{"/proc/self/fd", "fd"},
/* Child : if arg0 != NULL do execvp */
if(arg0 != NULL )
{
- execvp (arg0, arg);
+ BB_EXECVP(arg0, arg);
msg_logger_and_die(LOG_ERR, "execvp");
}
}
/* Public functions follow */
+int devfsd_main (int argc, char **argv);
int devfsd_main (int argc, char **argv)
{
int print_version = FALSE;
/* NB: The check for CONFIG_FILE is done in read_config_file() */
- if ( print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) )
- {
- printf( "%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n",
+ if (print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)) {
+ printf("%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n",
applet_name,DEVFSD_VERSION,bb_msg_proto_rev,
DEVFSD_PROTOCOL_REVISION_DAEMON,bb_msg_proto_rev, proto_rev);
if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)
/* Tell kernel we are special (i.e. we get to see hidden entries) */
do_ioctl_and_die(fd, DEVFSDIOC_SET_EVENT_MASK, 0);
- sigemptyset (&new_action.sa_mask);
+ sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
/* Set up SIGHUP and SIGUSR1 handlers */
new_action.sa_handler = signal_handler;
- if (sigaction (SIGHUP, &new_action, NULL) != 0 || sigaction (SIGUSR1, &new_action, NULL) != 0 )
+ if (sigaction(SIGHUP, &new_action, NULL) != 0 || sigaction (SIGUSR1, &new_action, NULL) != 0 )
devfsd_error_msg_and_die( "sigaction");
printf("%s v%s started for %s\n",applet_name, DEVFSD_VERSION, mount_point);
/* Set umask so that mknod(2), open(2) and mkdir(2) have complete control over permissions */
- umask (0);
- read_config_file (CONFIG_FILE, FALSE, &event_mask);
+ umask(0);
+ read_config_file((char*)CONFIG_FILE, FALSE, &event_mask);
/* Do the scan before forking, so that boot scripts see the finished product */
dir_operation(SERVICE,mount_point,0,NULL);
do_scan = do_servicing (fd, event_mask);
free_config ();
- read_config_file (CONFIG_FILE, FALSE, &event_mask);
+ read_config_file ((char*)CONFIG_FILE, FALSE, &event_mask);
if (do_scan)
dir_operation(SERVICE,mount_point,0,NULL);
}
struct stat statbuf;
FILE *fp;
char buf[STRING_LENGTH];
- char *line=NULL;
+ char *line = NULL;
debug_msg_logger(LOG_INFO, "%s: %s", __FUNCTION__, path);
if(optional == 0 && errno == ENOENT)
msg_logger_and_die(LOG_ERR, "read config file: %s: %m", path);
}
- return;
} /* End Function read_config_file */
static void process_config_line (const char *line, unsigned long *event_mask)
char p[MAX_ARGS][STRING_LENGTH];
char when[STRING_LENGTH], what[STRING_LENGTH];
char name[STRING_LENGTH];
- char * msg="";
+ const char *msg = "";
char *ptr;
int i;
char *argv[6];
char device[STRING_LENGTH];
- argv[0] = MODPROBE;
- argv[1] = MODPROBE_SWITCH_1; /* "-k" */
- argv[2] = MODPROBE_SWITCH_2; /* "-C" */
- argv[3] = CONFIG_MODULES_DEVFS;
+ argv[0] = (char*)MODPROBE;
+ argv[1] = (char*)MODPROBE_SWITCH_1; /* "-k" */
+ argv[2] = (char*)MODPROBE_SWITCH_2; /* "-C" */
+ argv[3] = (char*)CONFIG_MODULES_DEVFS;
argv[4] = device;
argv[5] = NULL;
ret = copy_inode (destination, &dest_stat, new_mode, source, &source_stat);
if (ENABLE_DEBUG && ret && (errno != EEXIST))
debug_msg_logger(LOG_ERR, "copy_inode: %s to %s: %m", source, destination);
- return;
} /* End Function action_copy */
static void action_compat (const struct devfsd_notify_struct *info, unsigned int action)
{
struct passwd *pw_ent;
struct group *grp_ent;
- static char *msg;
+ static const char *msg;
if (ENABLE_DEVFSD_VERBOSE)
msg="user";
struct translate_struct
{
- char *match; /* The string to match to (up to length) */
- char *format; /* Format of output, "%s" takes data past match string,
+ const char *match; /* The string to match to (up to length) */
+ const char *format; /* Format of output, "%s" takes data past match string,
NULL is effectively "%s" (just more efficient) */
};
static char *write_old_sd_name (char *buffer,
unsigned int major, unsigned int minor,
- char *part)
+ const char *part)
/* [SUMMARY] Write the old SCSI disc name to a buffer.
<buffer> The buffer to write to.
<major> The major number for the device.