diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-04 06:18:07 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-04 06:18:07 +0000 |
commit | 4731f878b70eeb1f7e180334e7939e546b1478b4 (patch) | |
tree | 858cd40fe8297597d39434fd8ee7658324d30af5 /libgo | |
parent | 3f7af571aa8bcd3707843c413b2baa06bbe46ff3 (diff) | |
download | gcc-4731f878b70eeb1f7e180334e7939e546b1478b4.zip gcc-4731f878b70eeb1f7e180334e7939e546b1478b4.tar.gz gcc-4731f878b70eeb1f7e180334e7939e546b1478b4.tar.bz2 |
runtime: Fix build failures with -D_FORTIFY_SOURCE=2.
From-SVN: r194116
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/runtime/go-signal.c | 5 | ||||
-rw-r--r-- | libgo/runtime/print.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c index a1215f9..6ac33d7 100644 --- a/libgo/runtime/go-signal.c +++ b/libgo/runtime/go-signal.c @@ -144,10 +144,13 @@ static int8 badsignal[] = "runtime: signal received on thread not created by Go. static void runtime_badsignal(int32 sig) { + // Avoid -D_FORTIFY_SOURCE problems. + int rv __attribute__((unused)); + if (sig == SIGPROF) { return; // Ignore SIGPROFs intended for a non-Go thread. } - runtime_write(2, badsignal, sizeof badsignal - 1); + rv = runtime_write(2, badsignal, sizeof badsignal - 1); runtime_exit(1); } diff --git a/libgo/runtime/print.c b/libgo/runtime/print.c index 42717bb..9e0c45b 100644 --- a/libgo/runtime/print.c +++ b/libgo/runtime/print.c @@ -18,7 +18,10 @@ gwrite(const void *v, int32 n) G* g = runtime_g(); if(g == nil || g->writebuf == nil) { - runtime_write(2, v, n); + // Avoid -D_FORTIFY_SOURCE problems. + int rv __attribute__((unused)); + + rv = runtime_write(2, v, n); return; } |