summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hector Martin2009-10-12 05:42:43 +0200
committerGravatar Hector Martin2009-10-12 05:42:43 +0200
commitac37795c7cca4d297ff860678a4197ee94d80f20 (patch)
treea7c9918deaf1d70f337527941ccfee847a4b82e5
parent5e63dd04443bd62af46caff8f50b71280256f1ae (diff)
downloadusbmuxd-ac37795c7cca4d297ff860678a4197ee94d80f20.tar.gz
usbmuxd-ac37795c7cca4d297ff860678a4197ee94d80f20.tar.bz2
optimize: considerable CPU usage was due to needless ops for unlogged messages
-rw-r--r--daemon/log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/log.c b/daemon/log.c
index 2ccb3cc..2392b0d 100644
--- a/daemon/log.c
+++ b/daemon/log.c
@@ -67,12 +67,12 @@ void usbmuxd_log(enum loglevel level, const char *fmt, ...)
struct timeval ts;
struct tm *tp;
- gettimeofday(&ts, NULL);
- tp = localtime(&ts.tv_sec);
-
if(level > log_level)
return;
+ gettimeofday(&ts, NULL);
+ tp = localtime(&ts.tv_sec);
+
fs = malloc(20 + strlen(fmt));
if(log_syslog) {