dev.attr.mode = strtol(temp, NULL, 8);
dbg_parse("name = %s, owner = %s, group = %s, mode = %#o",
- dev.attr.name, dev.attr.owner, dev.attr.group, dev.attr.mode);
+ dev.attr.name, dev.attr.owner, dev.attr.group,
+ dev.attr.mode);
retval = add_dev(&dev);
if (retval) {
dbg("add_dev returned with error %d", retval);
return retval;
}
-static int get_default_mode(struct sysfs_class_device *class_dev)
+static mode_t get_default_mode(struct sysfs_class_device *class_dev)
{
/* just default everyone to rw for the world! */
return 0666;
int retval = 0;
int found;
- attr->mode = -1;
+ attr->mode = 0;
if (class_dev->sysdevice) {
dbg_parse("class_dev->sysdevice->directory->path = '%s'", class_dev->sysdevice->directory->path);
dbg_parse("class_dev->sysdevice->bus_id = '%s'", class_dev->sysdevice->bus_id);
}
}
strcpy(attr->name, class_dev->name);
-
+
done:
- if (attr->mode == -1) {
+ /* mode was never set above */
+ if (!attr->mode) {
attr->mode = get_default_mode(class_dev);
attr->owner[0] = 0x00;
attr->group[0] = 0x00;
/*
* We also want to add some permissions here, and possibly some symlinks
*/
-static int create_node(char *name, char type, int major, int minor, int mode)
+static int create_node(char *name, char type, int major, int minor, mode_t mode)
{
char filename[255];
int retval = 0;
}
dbg("mknod(%s, %#o, %u, %u)", filename, mode, major, minor);
- retval = mknod(filename,mode,makedev(major,minor));
+ retval = mknod(filename, mode, makedev(major, minor));
if (retval)
dbg("mknod(%s, %#o, %u, %u) failed with error '%s'",
filename, mode, major, minor, strerror(errno));
char name[NAME_SIZE];
char owner[OWNER_SIZE];
char group[GROUP_SIZE];
- int mode;
+ mode_t mode;
};
extern int udev_add_device(char *device, char *subsystem);
char type;
int major;
int minor;
- int mode;
+ mode_t mode;
};
/**
char type;
int major;
int minor;
- int mode;
+ mode_t mode;
};
/* Function Prototypes */