[PATCH 8/9] sfdisk: fix compiler warning [-Wunused-result]

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

 



sfdisk.c: In function ‘do_fdisk’:
sfdisk.c:3212:11: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Uzel <petr.uzel@xxxxxxx>
---
 fdisk/sfdisk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
index 95e5828..0d36c3f 100644
--- a/fdisk/sfdisk.c
+++ b/fdisk/sfdisk.c
@@ -3208,7 +3208,7 @@ do_fdisk(char *dev) {
 		printf(_("Are you satisfied with this? [ynq] "));
 	    else
 		printf(_("Do you want to write this to disk? [ynq] "));
-	    fgets(answer, sizeof(answer), stdin);
+	    ignore_result( fgets(answer, sizeof(answer), stdin) );
 	    if (answer[0] == 'q' || answer[0] == 'Q') {
 		errx(EXIT_FAILURE, _("Quitting - nothing changed"));
 	    } else if (rpmatch(answer) == 1) {
-- 
1.7.7

--
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