/*
* udeveventrecorder.c
*
- * Userspace devfs
- *
- * Copyright (C) 2004, 2005 Olaf Hering <olh@suse.de>
+ * Copyright (C) 2004-2005 SuSE Linux Products GmbH
+ * Author:
+ * Olaf Hering <olh@suse.de>
*
* 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
#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);
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);
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);