/*
* Copyright (C) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
- * Copyright (C) 2004-2008 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2004-2008 Kay Sievers <kay@vrfy.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
{}
};
- info(udev, "version %s\n", VERSION);
+ log_debug("version %s\n", VERSION);
for (;;) {
int option;
if (option == -1)
break;
- dbg(udev, "option '%c'\n", option);
switch (option) {
case 'a':
action = optarg;
break;
case 'N':
- if (strcmp (optarg, "early") == 0) {
+ if (streq (optarg, "early")) {
resolve_names = 1;
- } else if (strcmp (optarg, "late") == 0) {
+ } else if (streq (optarg, "late")) {
resolve_names = 0;
- } else if (strcmp (optarg, "never") == 0) {
+ } else if (streq (optarg, "never")) {
resolve_names = -1;
} else {
fprintf(stderr, "resolve-names must be early, late or never\n");
- err(udev, "resolve-names must be early, late or never\n");
+ log_error("resolve-names must be early, late or never\n");
exit(EXIT_FAILURE);
}
break;
goto out;
}
- printf("This program is for debugging only, it does not run any program,\n"
+ printf("This program is for debugging only, it does not run any program\n"
"specified by a RUN key. It may show incorrect results, because\n"
"some values may be different, or not available at a simulation run.\n"
"\n");
}
/* add /sys if needed */
- if (strncmp(syspath, udev_get_sys_path(udev), strlen(udev_get_sys_path(udev))) != 0)
- util_strscpyl(filename, sizeof(filename), udev_get_sys_path(udev), syspath, NULL);
+ if (!startswith(syspath, "/sys"))
+ strscpyl(filename, sizeof(filename), "/sys", syspath, NULL);
else
- util_strscpy(filename, sizeof(filename), syspath);
+ strscpy(filename, sizeof(filename), syspath);
util_remove_trailing_chars(filename, '/');
dev = udev_device_new_from_syspath(udev, filename);