[Crash-utility] [PATCH RFC 13/14] task: format string should be never empty

Oleksandr Natalenko oleksandr at redhat.com
Fri Oct 27 08:23:19 UTC 2017


Signed-off-by: Oleksandr Natalenko <oleksandr at redhat.com>
---
 task.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/task.c b/task.c
index 261ca31..fd8503f 100644
--- a/task.c
+++ b/task.c
@@ -790,10 +790,11 @@ refresh_fixed_task_table(void)
 		return;
 
 	if (DUMPFILE()) {
-        	fprintf(fp, (pc->flags & SILENT) || !(pc->flags & TTY) ?
-                        "" : "%splease wait... (gathering task table data)",
-			GDB_PATCHED() ? "" : "\n");
-		fflush(fp);
+		if (!((pc->flags & SILENT) || !(pc->flags & TTY))) {
+			fprintf(fp, "%splease wait... (gathering task table data)",
+				GDB_PATCHED() ? "" : "\n");
+			fflush(fp);
+		}
 		if (!symbol_exists("panic_threads"))
 			tt->flags |= POPULATE_PANIC;
 	} 
@@ -933,10 +934,11 @@ refresh_unlimited_task_table(void)
 		return;
 
         if (DUMPFILE()) {
-                fprintf(fp, (pc->flags & SILENT) || !(pc->flags & TTY) ?
-                        "" : "%splease wait... (gathering task table data)",
-                        GDB_PATCHED() ? "" : "\n");
-                fflush(fp);
+			if (!((pc->flags & SILENT) || !(pc->flags & TTY))) {
+				fprintf(fp, "%splease wait... (gathering task table data)",
+					GDB_PATCHED() ? "" : "\n");
+				fflush(fp);
+			}
 		if (!symbol_exists("panic_threads"))
 			tt->flags |= POPULATE_PANIC;
         } 
-- 
2.14.3




More information about the Crash-utility mailing list