]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: m32r: fix syslog call
authorMike Frysinger <vapier@gentoo.org>
Fri, 8 Dec 2023 04:40:00 +0000 (21:40 -0700)
committerMike Frysinger <vapier@gentoo.org>
Fri, 8 Dec 2023 04:41:27 +0000 (21:41 -0700)
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

index 80c4360235b6bcec822a939fdd6dd7c70bf34dbc..51fe0d484a5e6b6fb610675f5297fecd8e295eb3 100644 (file)
@@ -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;