#include "logging.h"
#include "namedev.h"
-/* global variables */
-char **main_argv;
-char **main_envp;
-
#ifdef LOG
unsigned char logname[LOGNAME_SIZE];
char *subsystem = "";
struct udevice udev;
- main_argv = argv;
- main_envp = envp;
-
info("version %s", UDEV_VERSION);
if (argv[1] == NULL) {
subsystem = argv[2];
/* fill in values and test_run flag*/
- udev_set_values(&udev, devpath, subsystem);
+ udev_set_values(&udev, devpath, subsystem, "add");
/* open the device */
snprintf(path, SYSFS_PATH_MAX, "%s%s", sysfs_path, udev.devpath);
class_dev = sysfs_open_class_device_path(path);
- if (class_dev == NULL)
- dbg ("sysfs_open_class_device_path failed");
- else
- dbg("opened class_dev->name='%s'", class_dev->name);
+ if (class_dev == NULL) {
+ info("sysfs_open_class_device_path failed");
+ return 1;
+ }
+
+ dbg("opened class_dev->name='%s'", class_dev->name);
/* simulate node creation with test flag */
udev.test_run = 1;