[PATCH 29/33] swaplabel: 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>
---
 disk-utils/swaplabel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c
index 3e3e78b..a5ccb7e 100644
--- a/disk-utils/swaplabel.c
+++ b/disk-utils/swaplabel.c
@@ -145,7 +145,10 @@ static int change_info(const char *devname, const char *label, const char *uuid)
 		}
 	}
 
-	close(fd);
+	if (close_fd(fd) != 0) {
+		warn(_("write failed: %s"), devname);
+		return -1;
+	}
 	return 0;
 err:
 	if (fd >= 0)
-- 
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