#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
+#include <sysfs/libsysfs.h>
#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;
+#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)
{
struct dlist *attributes;
len--;
}
if (len == 0)
- printf(" SYSFS_%s=\"%s\"\n", attr->name, value);
+ printf(" SYSFS{%s}=\"%s\"\n", attr->name, value);
}
}
printf("\n");
" -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"
main_argv = argv;
main_argc = argc;
+ init_logging("udevinfo");
+
/* initialize our configuration */
udev_init_config();