aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-05-11 10:35:06 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-13 13:40:50 +0100
commit3fdecff96dd7516605ec9248b2a39de4db81306f (patch)
tree529617db84ba682d73a61049bbc2abc215087a58 /meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
parent93226e8c74be438781df79f0be5cbf563c79df8b (diff)
downloadopenembedded-core-contrib-3fdecff96dd7516605ec9248b2a39de4db81306f.tar.gz
glib-2.0: Ignore useless warning found with gcc-6
../../glib-2.46.2/glib/gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral] tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm); ^~~~~~ | ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c: In function 'test_strftime': | ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c:1338:3: error: '%c' yields only last 2 digits of year in some locales [-Werror=format-y2k] | "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \ Additionally fix the problem seen where write() return code is ignored Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch')
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
new file mode 100644
index 0000000000..aee96aaa6e
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
@@ -0,0 +1,42 @@
+From d6501b107940e9f548c89236d773c6d33c15a5c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 16 Apr 2016 13:28:59 -0700
+Subject: [PATCH 1/2] Do not ignore return value of write()
+
+gcc warns about ignoring return value when compiling
+with fortify turned on.
+
+assert when write() fails
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ glib/tests/unix.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/glib/tests/unix.c b/glib/tests/unix.c
+index 3543458..4e7ed85 100644
+--- a/glib/tests/unix.c
++++ b/glib/tests/unix.c
+@@ -32,14 +32,15 @@ test_pipe (void)
+ GError *error = NULL;
+ int pipefd[2];
+ char buf[1024];
+- ssize_t bytes_read;
++ ssize_t bytes_read, bytes_written;
+ gboolean res;
+
+ res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error);
+ g_assert (res);
+ g_assert_no_error (error);
+
+- write (pipefd[1], "hello", sizeof ("hello"));
++ bytes_written = write (pipefd[1], "hello", sizeof ("hello"));
++ g_assert (bytes_written != -1 && "write() failed");
+ memset (buf, 0, sizeof (buf));
+ bytes_read = read (pipefd[0], buf, sizeof(buf) - 1);
+ g_assert_cmpint (bytes_read, >, 0);
+--
+2.8.0
+