File util-linux-agetty-smart-reload-06.patch of Package python-libmount.15798

Refresh.
From 056a370efbd4b6540fb287e179fe41029c5808e1 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 11 Oct 2018 13:29:39 +0200
Subject: [PATCH 06/14] agetty: make output more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
---
 term-utils/agetty.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: util-linux-2.31.1/term-utils/agetty.c
===================================================================
--- util-linux-2.31.1.orig/term-utils/agetty.c
+++ util-linux-2.31.1/term-utils/agetty.c
@@ -1711,20 +1711,25 @@ static void print_issue_file(struct issu
 		}
 	}
 
-	write_all(STDOUT_FILENO, ie->mem, ie->mem_sz);
+	if (ie->mem_sz)
+		write_all(STDOUT_FILENO, ie->mem, ie->mem_sz);
+
 	if (ie->do_tcrestore) {
 		/* Restore settings. */
 		tp->c_oflag = oflag;
 		/* Wait till output is gone. */
 		tcsetattr(STDIN_FILENO, TCSADRAIN, tp);
 	}
+
 #ifdef AGETTY_RELOAD
 	free(ie->mem_old);
 	ie->mem_old = ie->mem;
 	ie->mem = NULL;
+	ie->mem_sz = 0;
 #else
 	free(ie->mem);
 	ie->mem = NULL;
+	ie->mem_sz = 0;
 #endif
 }
 
openSUSE Build Service is sponsored by