X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udevinfo.c;h=7991855b2812de55bec6567b27d9452f87ae36d0;hb=1d24d9977d46e20779e7d9d05f4b6aa6dcad28cc;hp=a2f5601b7c9b8518af3c88be5361f54bbe27a8ef;hpb=869fc2f1ff73209b9aa5dc7d582eba39feaf6f86;p=elogind.git diff --git a/udevinfo.c b/udevinfo.c index a2f5601b7..7991855b2 100644 --- a/udevinfo.c +++ b/udevinfo.c @@ -26,19 +26,30 @@ #include #include #include +#include #include "udev.h" #include "udev_version.h" #include "logging.h" #include "udevdb.h" -#include "libsysfs/libsysfs.h" # define SYSFS_VALUE_MAX 200 char **main_argv; int main_argc; -char **main_envp; + +#ifdef LOG +unsigned char logname[42]; +void log_message (int level, const char *format, ...) +{ + va_list args; + + va_start(args, format); + vsyslog(level, format, args); + va_end(args); +} +#endif static int print_all_attributes(const char *path) { @@ -79,7 +90,7 @@ static int print_all_attributes(const char *path) len--; } if (len == 0) - printf(" SYSFS_%s=\"%s\"\n", attr->name, value); + printf(" SYSFS{%s}=\"%s\"\n", attr->name, value); } } printf("\n"); @@ -398,7 +409,7 @@ help: " -n NAME node name used for query\n" "\n" " -r print udev root\n" - " -a print all attributes along the chain of the device\n" + " -a print all SYSFS_attributes along the device chain\n" " -d dump whole database\n" " -V print udev version\n" " -h print this help text\n" @@ -412,7 +423,8 @@ int main(int argc, char *argv[], char *envp[]) main_argv = argv; main_argc = argc; - main_envp = envp; + + init_logging("udevinfo"); /* initialize our configuration */ udev_init_config();