Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/miscutils/devfsd.c

    r2725 r3232  
    5454      Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
    5555*/
     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
    5671#include "libbb.h"
    5772#include "xregex.h"
     
    205220static void action_modload(const struct devfsd_notify_struct *info, const struct config_entry_struct *entry);
    206221static void action_copy(const struct devfsd_notify_struct *, const struct config_entry_struct *,
    207                          const regmatch_t *, unsigned);
     222                        const regmatch_t *, unsigned);
    208223static void action_compat(const struct devfsd_notify_struct *, unsigned);
    209224static void free_config(void);
     
    215230static int make_dir_tree(const char *);
    216231static int expand_expression(char *, unsigned, const char *, const char *(*)(const char *, void *), void *,
    217                              const char *, const regmatch_t *, unsigned);
     232                            const char *, const regmatch_t *, unsigned);
    218233static void expand_regexp(char *, size_t, const char *, const char *, const regmatch_t *, unsigned);
    219234static const char *expand_variable( char *, unsigned, unsigned *, const char *,
    220235                                    const char *(*)(const char *, void *), void *);
    221236static const char *get_variable_v2(const char *, const char *(*)(const char *, void *), void *);
    222 static char get_old_ide_name(unsigned , unsigned);
     237static char get_old_ide_name(unsigned, unsigned);
    223238static char *write_old_sd_name(char *, unsigned, unsigned, const char *);
    224239
     
    566581            the device name) to the module loading  facility.  In  addition,
    567582            the /etc/modules.devfs configuration file is used.*/
    568              if (ENABLE_DEVFSD_MODLOAD)
     583            if (ENABLE_DEVFSD_MODLOAD)
    569584                new->action.what = AC_MODLOAD;
    570              break;
     585            break;
    571586        case 6: /* EXECUTE */
    572587            new->action.what = AC_EXECUTE;
     
    736751
    737752static void action_modload(const struct devfsd_notify_struct *info,
    738                 const struct config_entry_struct *entry UNUSED_PARAM)
     753            const struct config_entry_struct *entry UNUSED_PARAM)
    739754/*  [SUMMARY] Load a module.
    740755    <info> The devfs change.
     
    757772
    758773static void action_execute(const struct devfsd_notify_struct *info,
    759                 const struct config_entry_struct *entry,
    760                 const regmatch_t *regexpr, unsigned int numexpr)
     774            const struct config_entry_struct *entry,
     775            const regmatch_t *regexpr, unsigned int numexpr)
    761776/*  [SUMMARY] Execute a programme.
    762777    <info> The devfs change.
     
    789804
    790805static void action_copy(const struct devfsd_notify_struct *info,
    791              const struct config_entry_struct *entry,
    792              const regmatch_t *regexpr, unsigned int numexpr)
     806            const struct config_entry_struct *entry,
     807            const regmatch_t *regexpr, unsigned int numexpr)
    793808/*  [SUMMARY] Copy permissions.
    794809    <info> The devfs change.
     
    12451260
    12461261static int expand_expression(char *output, unsigned int outsize,
    1247                   const char *input,
    1248                   const char *(*get_variable_func)(const char *variable, void *info),
    1249                   void *info,
    1250                   const char *devname,
    1251                   const regmatch_t *ex, unsigned int numexp)
     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)
    12521267/*  [SUMMARY] Expand environment variables and regular subexpressions in string.
    12531268    <output> The output expanded expression is written here.
     
    12741289
    12751290static void expand_regexp(char *output, size_t outsize, const char *input,
    1276                const char *devname,
    1277                const regmatch_t *ex, unsigned int numex)
     1291            const char *devname,
     1292            const regmatch_t *ex, unsigned int numex)
    12781293/*  [SUMMARY] Expand all occurrences of the regular subexpressions \0 to \9.
    12791294    <output> The output expanded expression is written here.
     
    13711386
    13721387const char *get_old_name(const char *devname, unsigned int namelen,
    1373               char *buffer, unsigned int major, unsigned int minor)
     1388            char *buffer, unsigned int major, unsigned int minor)
    13741389/*  [SUMMARY] Translate a kernel-supplied name into an old name.
    13751390    <devname> The device name provided by the kernel.
     
    14091424
    14101425    for (trans = translate_table; trans->match != NULL; ++trans) {
    1411          len = strlen(trans->match);
     1426        len = strlen(trans->match);
    14121427
    14131428        if (strncmp(devname, trans->match, len) == 0) {
     
    15351550
    15361551int st_expr_expand(char *output, unsigned int length, const char *input,
    1537              const char *(*get_variable_func)(const char *variable,
    1538                           void *info),
    1539              void *info)
     1552        const char *(*get_variable_func)(const char *variable,
     1553                        void *info),
     1554        void *info)
    15401555/*  [SUMMARY] Expand an expression using Borne Shell-like unquoted rules.
    15411556    <output> The output expanded expression is written here.
     
    16271642
    16281643static const char *expand_variable(char *buffer, unsigned int length,
    1629                     unsigned int *out_pos, const char *input,
    1630                     const char *(*func)(const char *variable,
    1631                              void *info),
    1632                     void *info)
     1644                unsigned int *out_pos, const char *input,
     1645                const char *(*func)(const char *variable,
     1646                            void *info),
     1647                void *info)
    16331648/*  [SUMMARY] Expand a variable.
    16341649    <buffer> The buffer to write to.
     
    17721787
    17731788static const char *get_variable_v2(const char *variable,
    1774                   const char *(*func)(const char *variable, void *info),
    1775                  void *info)
     1789                const char *(*func)(const char *variable, void *info),
     1790                void *info)
    17761791/*  [SUMMARY] Get a variable from the environment or .
    17771792    <variable> The variable name.
Note: See TracChangeset for help on using the changeset viewer.