[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] master - cleanup: dmeventd convert multiline to single line



Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d080abf7d60fc23343670e444d4cd26745e3e5d5
Commit:        d080abf7d60fc23343670e444d4cd26745e3e5d5
Parent:        7b17dfed69e50eabdc288f48a2fde16d4000709f
Author:        Zdenek Kabelac <zkabelac redhat com>
AuthorDate:    Mon Mar 10 09:45:03 2014 +0100
Committer:     Zdenek Kabelac <zkabelac redhat com>
CommitterDate: Mon Mar 10 12:24:10 2014 +0100

cleanup: dmeventd convert multiline to single line

Instead of doing multiple different calls, select
stream within a condition.

Replace fprintf with fputc for '\n'
---
 daemons/dmeventd/dmeventd.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 343180d..6206058 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -632,18 +632,10 @@ static void _no_intr_log(int level, const char *file, int line,
 		return;
 
 	va_start(ap, f);
-
-	if (level < _LOG_WARN)
-		vfprintf(stderr, f, ap);
-	else
-		vprintf(f, ap);
-
+	vfprintf((level < _LOG_WARN) ? stderr : stdout, f, ap);
 	va_end(ap);
 
-	if (level < _LOG_WARN)
-		fprintf(stderr, "\n");
-	else
-		fprintf(stdout, "\n");
+	fputc('\n', (level < _LOG_WARN) ? stderr : stdout);
 }
 
 static sigset_t _unblock_sigalrm(void)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]