[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Recursion in CfLog
From: |
Armin Wolfermann |
Subject: |
Recursion in CfLog |
Date: |
Mon, 1 Sep 2003 16:24:04 +0200 |
User-agent: |
Mutt/1.5.4i |
Hi,
these changes between 2.0.7p3 and 2.0.8 break cfengine if calls to
pthread_mutex_lock or pthread_mutex_unlock fail. Each run produced
a 650K logfile in my outputs directory.
--- cfengine-2.0.7p3/src/log.c Wed Apr 23 22:47:51 2003
+++ cfengine-2.0.8/src/log.c Mon Aug 18 15:24:41 2003
@@ -63,6 +63,14 @@
}
}
+
+#if defined HAVE_PTHREAD_H && (defined HAVE_LIBPTHREAD || defined
BUILDTIN_GCC_THREAD)
+if (!SILENT && (pthread_mutex_lock(&MUTEX_SYSCALL) != 0))
+ {
+ CfLog(cferror,"pthread_mutex_lock failed","lock");
+ }
+#endif
+
switch(level)
{
case cfsilent: if (! SILENT || VERBOSE || DEBUG || D2)
@@ -159,8 +167,16 @@
syslog(LOG_ERR, " %s: %s",errstr,strerror(errno));
}
}
- return;
}
+
+
+
+#if defined HAVE_PTHREAD_H && (defined HAVE_LIBPTHREAD || defined
BUILDTIN_GCC_THREAD)
+ if (pthread_mutex_unlock(&MUTEX_SYSCALL) != 0)
+ {
+ CfLog(cferror,"pthread_mutex_unlock failed","lock");
+ }
+#endif
if (endl && (buffer[strlen(buffer)-1] != '\n'))
Regards,
Armin Wolfermann
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Recursion in CfLog,
Armin Wolfermann <=