diff options
| author | Rob Landley <rob@landley.net> | 2006-02-22 17:01:00 +0000 |
|---|---|---|
| committer | Rob Landley <rob@landley.net> | 2006-02-22 17:01:00 +0000 |
| commit | 0a7c8ef6e220b5f8fff4f2cb0af630255a2a6a58 (patch) | |
| tree | f32eb89325299a3abade721ffe149b0e516747c1 /miscutils/devfsd.c | |
| parent | fb16d5c6aa8aef30d313356b5a83ef0a60114c9a (diff) | |
| download | busybox-w32-0a7c8ef6e220b5f8fff4f2cb0af630255a2a6a58.tar.gz busybox-w32-0a7c8ef6e220b5f8fff4f2cb0af630255a2a6a58.tar.bz2 busybox-w32-0a7c8ef6e220b5f8fff4f2cb0af630255a2a6a58.zip | |
Patch from Denis Vlasenko to constify things and fix a few typos.
Diffstat (limited to 'miscutils/devfsd.c')
| -rw-r--r-- | miscutils/devfsd.c | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index fd5f54763..f99a94628 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c | |||
| @@ -606,17 +606,18 @@ static void process_config_line (const char *line, unsigned long *event_mask) | |||
| 606 | char name[STRING_LENGTH]; | 606 | char name[STRING_LENGTH]; |
| 607 | char * msg=""; | 607 | char * msg=""; |
| 608 | char *ptr; | 608 | char *ptr; |
| 609 | int i; | ||
| 609 | 610 | ||
| 610 | /* !!!! Only Uppercase Keywords in devsfd.conf */ | 611 | /* !!!! Only Uppercase Keywords in devsfd.conf */ |
| 611 | const char *options[] = { "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE", | 612 | static const char *const options[] = { |
| 612 | "PERMISSIONS", "MODLOAD", "EXECUTE", "COPY", "IGNORE", | 613 | "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", |
| 613 | "MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT", 0 }; | 614 | "RESTORE", "PERMISSIONS", "MODLOAD", "EXECUTE", |
| 614 | 615 | "COPY", "IGNORE", "MKOLDCOMPAT", "MKNEWCOMPAT", | |
| 615 | int i; | 616 | "RMOLDCOMPAT", "RMNEWCOMPAT", 0 |
| 617 | }; | ||
| 616 | 618 | ||
| 617 | debug_msg_logger(LOG_INFO, __FUNCTION__); | 619 | debug_msg_logger(LOG_INFO, __FUNCTION__); |
| 618 | 620 | ||
| 619 | |||
| 620 | for (count = 0; count < MAX_ARGS; ++count) p[count][0] = '\0'; | 621 | for (count = 0; count < MAX_ARGS; ++count) p[count][0] = '\0'; |
| 621 | num_args = sscanf (line, "%s %s %s %s %s %s %s %s %s %s", | 622 | num_args = sscanf (line, "%s %s %s %s %s %s %s %s %s %s", |
| 622 | when, name, what, | 623 | when, name, what, |
| @@ -678,7 +679,7 @@ static void process_config_line (const char *line, unsigned long *event_mask) | |||
| 678 | if ( ( ptr = strchr (p[0], '.') ) == NULL ) | 679 | if ( ( ptr = strchr (p[0], '.') ) == NULL ) |
| 679 | { | 680 | { |
| 680 | msg="UID.GID"; | 681 | msg="UID.GID"; |
| 681 | goto process_config_line_err; /*"missing '.' in UID.GID */ | 682 | goto process_config_line_err; /*"missing '.' in UID.GID"*/ |
| 682 | } | 683 | } |
| 683 | 684 | ||
| 684 | *ptr++ = '\0'; | 685 | *ptr++ = '\0'; |
| @@ -993,17 +994,19 @@ static void action_compat (const struct devfsd_notify_struct *info, unsigned int | |||
| 993 | unsigned int i; | 994 | unsigned int i; |
| 994 | char rewind_; | 995 | char rewind_; |
| 995 | /* 1 to 5 "scsi/" , 6 to 9 "ide/host" */ | 996 | /* 1 to 5 "scsi/" , 6 to 9 "ide/host" */ |
| 996 | const char *fmt[] = { NULL , | 997 | static const char *const fmt[] = { |
| 997 | "sg/c%db%dt%du%d", /* scsi/generic */ | 998 | NULL , |
| 998 | "sd/c%db%dt%du%d", /* scsi/disc */ | 999 | "sg/c%db%dt%du%d", /* scsi/generic */ |
| 999 | "sr/c%db%dt%du%d", /* scsi/cd */ | 1000 | "sd/c%db%dt%du%d", /* scsi/disc */ |
| 1000 | "sd/c%db%dt%du%dp%d", /* scsi/part */ | 1001 | "sr/c%db%dt%du%d", /* scsi/cd */ |
| 1001 | "st/c%db%dt%du%dm%d%c", /* scsi/mt */ | 1002 | "sd/c%db%dt%du%dp%d", /* scsi/part */ |
| 1002 | "ide/hd/c%db%dt%du%d", /* ide/host/disc */ | 1003 | "st/c%db%dt%du%dm%d%c", /* scsi/mt */ |
| 1003 | "ide/cd/c%db%dt%du%d", /* ide/host/cd */ | 1004 | "ide/hd/c%db%dt%du%d", /* ide/host/disc */ |
| 1004 | "ide/hd/c%db%dt%du%dp%d", /* ide/host/part */ | 1005 | "ide/cd/c%db%dt%du%d", /* ide/host/cd */ |
| 1005 | "ide/mt/c%db%dt%du%d%s", /* ide/host/mt */ | 1006 | "ide/hd/c%db%dt%du%dp%d", /* ide/host/part */ |
| 1006 | NULL }; | 1007 | "ide/mt/c%db%dt%du%d%s", /* ide/host/mt */ |
| 1008 | NULL | ||
| 1009 | }; | ||
| 1007 | 1010 | ||
| 1008 | /* First construct compatibility name */ | 1011 | /* First construct compatibility name */ |
| 1009 | switch (action) | 1012 | switch (action) |
| @@ -1596,20 +1599,22 @@ const char *get_old_name (const char *devname, unsigned int namelen, | |||
| 1596 | const char *pty2; | 1599 | const char *pty2; |
| 1597 | size_t len; | 1600 | size_t len; |
| 1598 | /* 1 to 5 "scsi/" , 6 to 9 "ide/host", 10 sbp/, 11 vcc/, 12 pty/ */ | 1601 | /* 1 to 5 "scsi/" , 6 to 9 "ide/host", 10 sbp/, 11 vcc/, 12 pty/ */ |
| 1599 | const char *fmt[] = { NULL , | 1602 | static const char *const fmt[] = { |
| 1600 | "sg%u", /* scsi/generic */ | 1603 | NULL , |
| 1601 | NULL, /* scsi/disc */ | 1604 | "sg%u", /* scsi/generic */ |
| 1602 | "sr%u", /* scsi/cd */ | 1605 | NULL, /* scsi/disc */ |
| 1603 | NULL, /* scsi/part */ | 1606 | "sr%u", /* scsi/cd */ |
| 1604 | "nst%u%c", /* scsi/mt */ | 1607 | NULL, /* scsi/part */ |
| 1605 | "hd%c" , /* ide/host/disc */ | 1608 | "nst%u%c", /* scsi/mt */ |
| 1606 | "hd%c" , /* ide/host/cd */ | 1609 | "hd%c" , /* ide/host/disc */ |
| 1607 | "hd%c%s", /* ide/host/part */ | 1610 | "hd%c" , /* ide/host/cd */ |
| 1608 | "%sht%d", /* ide/host/mt */ | 1611 | "hd%c%s", /* ide/host/part */ |
| 1609 | "sbpcd%u", /* sbp/ */ | 1612 | "%sht%d", /* ide/host/mt */ |
| 1610 | "vcs%s", /* vcc/ */ | 1613 | "sbpcd%u", /* sbp/ */ |
| 1611 | "%cty%c%c", /* pty/ */ | 1614 | "vcs%s", /* vcc/ */ |
| 1612 | NULL }; | 1615 | "%cty%c%c", /* pty/ */ |
| 1616 | NULL | ||
| 1617 | }; | ||
| 1613 | 1618 | ||
| 1614 | debug_msg_logger(LOG_INFO, __FUNCTION__); | 1619 | debug_msg_logger(LOG_INFO, __FUNCTION__); |
| 1615 | 1620 | ||
