[3/3,committed] sim: m32r: fix syslog call

Message ID 20231208044203.25315-3-vapier@gentoo.org
State New
Headers
Series [1/3,committed] sim: m32r: add more cgen prototypes for traps |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch is already merged

Commit Message

Mike Frysinger Dec. 8, 2023, 4:42 a.m. UTC
  The function returns void, not int.  We only pass one argument to
syslog (the format), so use %s as the static format instead since
the emulation layer doesn't handle passing additional arguments.
---
 sim/m32r/traps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c
index 80c4360235b6..51fe0d484a5e 100644
--- a/sim/m32r/traps.c
+++ b/sim/m32r/traps.c
@@ -843,7 +843,8 @@  m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
 	    break;
 
 	  case TARGET_LINUX_SYS_syslog:
-	    result = syslog (arg1, (char *) t2h_addr (cb, &s, arg2));
+	    syslog (arg1, "%s", (char *) t2h_addr (cb, &s, arg2));
+	    result = 0;
 	    errcode = errno;
 	    break;