ps: conditionally enable -T on non-DESKTOP build too
[oweals/busybox.git] / miscutils / devfsd.c
index c85ff08f320991cee00b0aa37de51c92df79ff8c..5e3ee23b3a8ba99ad9ccac93646e26ab1613f829 100644 (file)
@@ -92,8 +92,8 @@
 #define DEVFS_PATHLEN               1024
 /*  Never change this otherwise the binary interface will change   */
 
-struct devfsd_notify_struct
-{      /*  Use native C types to ensure same types in kernel and user space     */
+struct devfsd_notify_struct {
+       /*  Use native C types to ensure same types in kernel and user space     */
        unsigned int type;           /*  DEVFSD_NOTIFY_* value                   */
        unsigned int mode;           /*  Mode of the inode or device entry       */
        unsigned int major;          /*  Major number of device entry            */
@@ -151,32 +151,27 @@ struct devfsd_notify_struct
 #define AC_RMNEWCOMPAT                         10
 #define AC_RESTORE                                     11
 
-struct permissions_type
-{
+struct permissions_type {
        mode_t mode;
        uid_t uid;
        gid_t gid;
 };
 
-struct execute_type
-{
+struct execute_type {
        char *argv[MAX_ARGS + 1];  /*  argv[0] must always be the programme  */
 };
 
-struct copy_type
-{
+struct copy_type {
        const char *source;
        const char *destination;
 };
 
-struct action_type
-{
+struct action_type {
        unsigned int what;
        unsigned int when;
 };
 
-struct config_entry_struct
-{
+struct config_entry_struct {
        struct action_type action;
        regex_t preg;
        union
@@ -189,8 +184,7 @@ struct config_entry_struct
        struct config_entry_struct *next;
 };
 
-struct get_variable_info
-{
+struct get_variable_info {
        const struct devfsd_notify_struct *info;
        const char *devname;
        char devpath[STRING_LENGTH];
@@ -459,7 +453,7 @@ static void read_config_file(char *path, int optional, unsigned long *event_mask
                        free(p);
                        return;
                }
-               fp = fopen(path, "r");
+               fp = fopen_for_read(path);
                if (fp != NULL) {
                        while (fgets(buf, STRING_LENGTH, fp) != NULL) {
                                /*  Skip whitespace  */
@@ -1336,8 +1330,7 @@ static void expand_regexp(char *output, size_t outsize, const char *input,
 
 /* from compat_name.c */
 
-struct translate_struct
-{
+struct translate_struct {
        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)       */