static int import_uevent_var(struct udev *udev, const char *devpath)
{
- char path[PATH_SIZE];
+ char path[UTIL_PATH_SIZE];
static char value[4096]; /* must stay, used with putenv */
ssize_t size;
int fd;
int rc = -1;
/* read uevent file */
- strlcpy(path, udev_get_sys_path(udev), sizeof(path));
- strlcat(path, devpath, sizeof(path));
- strlcat(path, "/uevent", sizeof(path));
+ util_strlcpy(path, udev_get_sys_path(udev), sizeof(path));
+ util_strlcat(path, devpath, sizeof(path));
+ util_strlcat(path, "/uevent", sizeof(path));
fd = open(path, O_RDONLY);
if (fd < 0)
goto out;
int rc = 0;
static const struct option options[] = {
- { "action", 1, NULL, 'a' },
- { "subsystem", 1, NULL, 's' },
- { "force", 0, NULL, 'f' },
- { "help", 0, NULL, 'h' },
+ { "action", required_argument, NULL, 'a' },
+ { "subsystem", required_argument, NULL, 's' },
+ { "force", no_argument, NULL, 'f' },
+ { "help", no_argument, NULL, 'h' },
{}
};
}
if (subsystem != NULL)
- strlcpy(dev->subsystem, subsystem, sizeof(dev->subsystem));
+ util_strlcpy(dev->subsystem, subsystem, sizeof(dev->subsystem));
/* override built-in sysfs device */
udevice->dev = dev;
- strlcpy(udevice->action, action, sizeof(udevice->action));
+ util_strlcpy(udevice->action, action, sizeof(udevice->action));
udevice->devt = udev_device_get_devt(udevice);
/* simulate node creation with test flag */
struct name_entry *name_loop;
list_for_each_entry(name_loop, &udevice->run_list, node) {
- char program[PATH_SIZE];
+ char program[UTIL_PATH_SIZE];
- strlcpy(program, name_loop->name, sizeof(program));
+ util_strlcpy(program, name_loop->name, sizeof(program));
udev_rules_apply_format(udevice, program, sizeof(program));
info(udev, "run: '%s'\n", program);
}