Module: xenomai-jki
Branch: for-forge
Commit: 520fc6ac080f2b4a47e39eaa7838270fb2768748
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=520fc6ac080f2b4a47e39eaa7838270fb2768748

Author: Gernot Hillier <gernot.hill...@siemens.com>
Date:   Tue Jan 14 13:28:16 2014 +0100

Silence unused_result warning from write()

Some glibc versions mark write() with attribute warn_unused_result (found in
Ubuntu 12.04 / eglibc 2.15 / gcc 4.6.3), so we need to silence this warning,
especially because we're building with -Werror.

Signed-off-by: Gernot Hillier <gernot.hill...@siemens.com>
Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 lib/cobalt/init.c           |    3 ++-
 testsuite/latency/latency.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c
index 0c2b29a..c3086a9 100644
--- a/lib/cobalt/init.c
+++ b/lib/cobalt/init.c
@@ -54,7 +54,8 @@ int __rtdm_fd_start = INT_MAX;
 static void sigill_handler(int sig)
 {
        const char m[] = "no Xenomai support in kernel?\n";
-       write(2, m, sizeof(m) - 1);
+       ssize_t rc __attribute__ ((unused));
+       rc = write(2, m, sizeof(m) - 1);
        exit(EXIT_FAILURE);
 }
 
diff --git a/testsuite/latency/latency.c b/testsuite/latency/latency.c
index 6325672..12b90a9 100644
--- a/testsuite/latency/latency.c
+++ b/testsuite/latency/latency.c
@@ -507,7 +507,7 @@ static void sigdebug(int sig, siginfo_t *si, void *context)
        case SIGDEBUG_WATCHDOG:
                n = snprintf(buffer, sizeof(buffer), "%s\n",
                             reason_str[reason]);
-               write(STDERR_FILENO, buffer, n);
+               n = write(STDERR_FILENO, buffer, n);
                exit(EXIT_FAILURE);
        }
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to