Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/miscutils/devfsd.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/miscutils/devfsd.c
r2725 r3232 54 54 Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia. 55 55 */ 56 57 //usage:#define devfsd_trivial_usage 58 //usage: "mntpnt [-v]" IF_DEVFSD_FG_NP("[-fg][-np]") 59 //usage:#define devfsd_full_usage "\n\n" 60 //usage: "Manage devfs permissions and old device name symlinks\n" 61 //usage: "\n mntpnt The mount point where devfs is mounted" 62 //usage: "\n -v Print the protocol version numbers for devfsd" 63 //usage: "\n and the kernel-side protocol version and exit" 64 //usage: IF_DEVFSD_FG_NP( 65 //usage: "\n -fg Run in foreground" 66 //usage: "\n -np Exit after parsing the configuration file" 67 //usage: "\n and processing synthetic REGISTER events," 68 //usage: "\n don't poll for events" 69 //usage: ) 70 56 71 #include "libbb.h" 57 72 #include "xregex.h" … … 205 220 static void action_modload(const struct devfsd_notify_struct *info, const struct config_entry_struct *entry); 206 221 static void action_copy(const struct devfsd_notify_struct *, const struct config_entry_struct *, 207 222 const regmatch_t *, unsigned); 208 223 static void action_compat(const struct devfsd_notify_struct *, unsigned); 209 224 static void free_config(void); … … 215 230 static int make_dir_tree(const char *); 216 231 static int expand_expression(char *, unsigned, const char *, const char *(*)(const char *, void *), void *, 217 232 const char *, const regmatch_t *, unsigned); 218 233 static void expand_regexp(char *, size_t, const char *, const char *, const regmatch_t *, unsigned); 219 234 static const char *expand_variable( char *, unsigned, unsigned *, const char *, 220 235 const char *(*)(const char *, void *), void *); 221 236 static const char *get_variable_v2(const char *, const char *(*)(const char *, void *), void *); 222 static char get_old_ide_name(unsigned 237 static char get_old_ide_name(unsigned, unsigned); 223 238 static char *write_old_sd_name(char *, unsigned, unsigned, const char *); 224 239 … … 566 581 the device name) to the module loading facility. In addition, 567 582 the /etc/modules.devfs configuration file is used.*/ 568 583 if (ENABLE_DEVFSD_MODLOAD) 569 584 new->action.what = AC_MODLOAD; 570 585 break; 571 586 case 6: /* EXECUTE */ 572 587 new->action.what = AC_EXECUTE; … … 736 751 737 752 static void action_modload(const struct devfsd_notify_struct *info, 738 753 const struct config_entry_struct *entry UNUSED_PARAM) 739 754 /* [SUMMARY] Load a module. 740 755 <info> The devfs change. … … 757 772 758 773 static void action_execute(const struct devfsd_notify_struct *info, 759 760 774 const struct config_entry_struct *entry, 775 const regmatch_t *regexpr, unsigned int numexpr) 761 776 /* [SUMMARY] Execute a programme. 762 777 <info> The devfs change. … … 789 804 790 805 static void action_copy(const struct devfsd_notify_struct *info, 791 792 806 const struct config_entry_struct *entry, 807 const regmatch_t *regexpr, unsigned int numexpr) 793 808 /* [SUMMARY] Copy permissions. 794 809 <info> The devfs change. … … 1245 1260 1246 1261 static int expand_expression(char *output, unsigned int outsize, 1247 1248 1249 1250 1251 1262 const char *input, 1263 const char *(*get_variable_func)(const char *variable, void *info), 1264 void *info, 1265 const char *devname, 1266 const regmatch_t *ex, unsigned int numexp) 1252 1267 /* [SUMMARY] Expand environment variables and regular subexpressions in string. 1253 1268 <output> The output expanded expression is written here. … … 1274 1289 1275 1290 static void expand_regexp(char *output, size_t outsize, const char *input, 1276 1277 1291 const char *devname, 1292 const regmatch_t *ex, unsigned int numex) 1278 1293 /* [SUMMARY] Expand all occurrences of the regular subexpressions \0 to \9. 1279 1294 <output> The output expanded expression is written here. … … 1371 1386 1372 1387 const char *get_old_name(const char *devname, unsigned int namelen, 1373 1388 char *buffer, unsigned int major, unsigned int minor) 1374 1389 /* [SUMMARY] Translate a kernel-supplied name into an old name. 1375 1390 <devname> The device name provided by the kernel. … … 1409 1424 1410 1425 for (trans = translate_table; trans->match != NULL; ++trans) { 1411 1426 len = strlen(trans->match); 1412 1427 1413 1428 if (strncmp(devname, trans->match, len) == 0) { … … 1535 1550 1536 1551 int st_expr_expand(char *output, unsigned int length, const char *input, 1537 1538 1539 1552 const char *(*get_variable_func)(const char *variable, 1553 void *info), 1554 void *info) 1540 1555 /* [SUMMARY] Expand an expression using Borne Shell-like unquoted rules. 1541 1556 <output> The output expanded expression is written here. … … 1627 1642 1628 1643 static const char *expand_variable(char *buffer, unsigned int length, 1629 1630 1631 1632 1644 unsigned int *out_pos, const char *input, 1645 const char *(*func)(const char *variable, 1646 void *info), 1647 void *info) 1633 1648 /* [SUMMARY] Expand a variable. 1634 1649 <buffer> The buffer to write to. … … 1772 1787 1773 1788 static const char *get_variable_v2(const char *variable, 1774 1775 1789 const char *(*func)(const char *variable, void *info), 1790 void *info) 1776 1791 /* [SUMMARY] Get a variable from the environment or . 1777 1792 <variable> The variable name.
Note:
See TracChangeset
for help on using the changeset viewer.