tests: fdsrc: don't ignore return value of write()
authorTim-Philipp Müller <tim@centricular.com>
Tue, 28 Oct 2014 09:28:28 +0000 (09:28 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 28 Oct 2014 09:28:28 +0000 (09:28 +0000)
Causes compiler warnings on some systems.

tests/check/elements/fdsrc.c

index abcf951..ffe6194 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <errno.h>
 
 #include <gst/check/gstcheck.h>
 
@@ -98,7 +99,8 @@ GST_START_TEST (test_num_buffers)
 
   memset (data, 0, 4096);
   while (!have_eos) {
-    write (pipe_fd[1], data, 4096);
+    int ret = write (pipe_fd[1], data, 4096);
+    fail_if (ret < 0 && errno != EAGAIN);
     g_usleep (100);
   }