build: suppress an ignored-write-return-value warning
authorJim Meyering <meyering@redhat.com>
Tue, 18 Aug 2009 12:55:59 +0000 (14:55 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 18 Aug 2009 15:20:06 +0000 (17:20 +0200)
* bootstrap (modules): Add ignore-value.
* src/guestfs.c: Include "ignore-value.h".
(stdout_event): Ignore failure to write to stderr.
Also, prefer STDERR_FILENO over the literal "2".
* src/Makefile.am (libguestfs_la_CPPFLAGS): Include gnulib's .h files.
(libprotocol_la_CFLAGS): Remove -Wall -Wno-unused.

bootstrap
src/Makefile.am
src/guestfs.c

index cea8c40..76e2216 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -53,6 +53,7 @@ modules='
 gitlog-to-changelog
 gnu-make
 gnumakefile
 gitlog-to-changelog
 gnu-make
 gnumakefile
+ignore-value
 maintainer-makefile
 manywarnings
 warnings
 maintainer-makefile
 manywarnings
 warnings
index 9eb71b9..8d03a77 100644 (file)
@@ -54,7 +54,7 @@ libprotocol_la_SOURCES = \
   guestfs_protocol.c \
   guestfs_protocol.h
 
   guestfs_protocol.c \
   guestfs_protocol.h
 
-libprotocol_la_CFLAGS = -Wall -Wno-unused
+libprotocol_la_CFLAGS =
 
 $(BUILT_SOURCES): stamp-generator
 
 
 $(BUILT_SOURCES): stamp-generator
 
@@ -117,6 +117,8 @@ libguestfs_la_LIBADD = libprotocol.la
 
 libguestfs_la_CFLAGS = -Wall -DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
 
 
 libguestfs_la_CFLAGS = -Wall -DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
 
+libguestfs_la_CPPFLAGS = -I$(top_srcdir)/gnulib/lib
+
 if HAVE_RPCGEN
 guestfs_protocol.c: guestfs_protocol.x
        rm -f $@-t $@-t2
 if HAVE_RPCGEN
 guestfs_protocol.c: guestfs_protocol.x
        rm -f $@-t $@-t2
index ad3980f..ecdf9e5 100644 (file)
@@ -59,6 +59,7 @@
 
 #include "guestfs.h"
 #include "guestfs_protocol.h"
 
 #include "guestfs.h"
 #include "guestfs_protocol.h"
+#include "ignore-value.h"
 
 #ifdef HAVE_GETTEXT
 #include "gettext.h"
 
 #ifdef HAVE_GETTEXT
 #include "gettext.h"
@@ -1697,7 +1698,7 @@ stdout_event (struct guestfs_main_loop *ml, guestfs_h *g, void *data,
 
   /* In verbose mode, copy all log messages to stderr. */
   if (g->verbose)
 
   /* In verbose mode, copy all log messages to stderr. */
   if (g->verbose)
-    write (2, buf, n);
+    ignore_value (write (STDERR_FILENO, buf, n));
 
   /* It's an actual log message, send it upwards if anyone is listening. */
   if (g->log_message_cb)
 
   /* It's an actual log message, send it upwards if anyone is listening. */
   if (g->log_message_cb)