[Buildroot] [PATCH] target/makedev: fix compile breakage from unused result warning

Jeremy Kerr jk at ozlabs.org
Mon Nov 24 23:41:26 UTC 2008


Compiling current SVN fails with the following error for me:

 cc1: warnings being treated as errors
 buildroot/buildroot/build_powerpc/makedevs/makedevs.c: In function ‘main’:
 buildroot/buildroot/build_powerpc/makedevs/makedevs.c:531: error:
 ignoring return value of ‘system’, declared with attribute
 warn_unused_result

This change adds a simple warning if system() fails.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

---

 target/makedevs/makedevs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: buildroot/target/makedevs/makedevs.c
===================================================================
--- buildroot.orig/target/makedevs/makedevs.c	2008-11-24 11:25:03.000000000 +1100
+++ buildroot/target/makedevs/makedevs.c	2008-11-24 11:34:51.000000000 +1100
@@ -528,7 +528,8 @@ loop:
 	}
 	fclose(table);
 
-	system("/bin/sync");
+	if (system("/bin/sync"))
+		bb_error_msg("sync failed, continuing anyway");
 
 	return 0;
 }



More information about the buildroot mailing list