[PATCH 33/33] wall: check writing to a file descriptor was successful

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

 



Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 term-utils/ttymsg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/term-utils/ttymsg.c b/term-utils/ttymsg.c
index 66b61b4..d610826 100644
--- a/term-utils/ttymsg.c
+++ b/term-utils/ttymsg.c
@@ -169,7 +169,8 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
 		 */
 		if (errno == ENODEV || errno == EIO)
 			break;
-		(void) close(fd);
+		if (close_fd(fd) != 0)
+			warn(_("write failed: %s"), device);
 		if (forked)
 			_exit(EXIT_FAILURE);
 		if (strlen(strerror(errno)) > 1000)
@@ -184,7 +185,6 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
 		return (errbuf);
 	}
 
-	(void) close(fd);
 	if (forked)
 		_exit(EXIT_SUCCESS);
 	return (NULL);
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux