Skip to contentSkip to conversation

target/makedev: fix compile breakage from unused result warning

PATCH New Jeremy Kerr 2 participants 2 messages Nov 24, 2008 – Dec 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/makedev: fix compile breakage from unused result warning

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.

---

 target/makedevs/makedevs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
target/makedevs/makedevs.c +2 -1
Index: buildroot/target/makedevs/makedevs.c
===================================================================
@@ -528,7 +528,8 @@ loop:
 	}
 	fclose(table);
 
-	system("/bin/sync");
+	if (system("/bin/sync"))
+		bb_error_msg("sync failed, continuing anyway");
 
 	return 0;
 }
#1 lore raw

PATCH 1/1 target/makedev: fix compile breakage from unused result warning

Le Tue, 25 Nov 2008 10:41:26 +1100,
Jeremy Kerr <[email protected]> a ?crit :

Quoted 1 line

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

Thanks, applied as r24236.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com