X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udeveventrecorder.c;h=422cf88ff0029c9483ce7d4c09c8c4abdc6f2910;hp=af7ea7c15c3471fb7389db1e57c93f5036fec034;hb=f5f8f316aa66251d0ccf71b940182a9d00dbd040;hpb=3632a3685883d3270145c59d5764de6246547943 diff --git a/udeveventrecorder.c b/udeveventrecorder.c index af7ea7c15..422cf88ff 100644 --- a/udeveventrecorder.c +++ b/udeveventrecorder.c @@ -1,9 +1,9 @@ /* * udeveventrecorder.c * - * Userspace devfs - * - * Copyright (C) 2004, 2005 Olaf Hering + * Copyright (C) 2004-2005 SuSE Linux Products GmbH + * Author: + * Olaf Hering * * 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 the @@ -37,14 +37,14 @@ #define BUFSIZE 12345 #define FNSIZE 123 -static int log = 0; +static int udev_log = 0; #ifdef USE_LOG void log_message (int priority, const char *format, ...) { va_list args; - if (priority > log) + if (priority > udev_log) return; va_start(args, format); @@ -63,11 +63,11 @@ int main(int argc, char **argv, char **envp) const char *env; if (stat("/events", &sb) || !(S_ISDIR(sb.st_mode))) - return 1; + return 0; env = getenv("UDEV_LOG"); if (env) - log = log_priority(env); + udev_log = log_priority(env); logging_init("udeveventrecorder"); dbg("version %s", UDEV_VERSION); @@ -84,7 +84,7 @@ int main(int argc, char **argv, char **envp) snprintf(buf, FNSIZE, "/events/debug.%05lu.%s.%s.%u", seq, argv[1], a ? a : "", getpid()); if ((fd = open(buf, O_CREAT | O_WRONLY | O_TRUNC, 0644)) < 0) { - err("error creating '%s'", buf); + err("error creating '%s': %s", buf, strerror(errno)); goto error; } free(buf);