runtime: Fix build failures with -D_FORTIFY_SOURCE=2.

From-SVN: r194116
This commit is contained in:
Ian Lance Taylor 2012-12-04 06:18:07 +00:00
parent 3f7af571aa
commit 4731f878b7
2 changed files with 8 additions and 2 deletions

View File

@ -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);
}

View File

@ -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;
}