aboutsummaryrefslogtreecommitdiff
path: root/sim/sh
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-06 21:01:41 -0400
committerMike Frysinger <vapier@gentoo.org>2021-11-06 21:03:01 -0400
commit4a0bb487b8027a317b5c7011d870ae719098e8f0 (patch)
tree535c0c7801eb5cc6ff7f4c121dd7afcaf2210cab /sim/sh
parent73eef3fc38780753a30954d52b86beb1a281f783 (diff)
downloadgdb-4a0bb487b8027a317b5c7011d870ae719098e8f0.zip
gdb-4a0bb487b8027a317b5c7011d870ae719098e8f0.tar.gz
gdb-4a0bb487b8027a317b5c7011d870ae719098e8f0.tar.bz2
sim: sh: break utime logic out of _WIN32 check
Some _WIN32 targets provide utime (like mingw), so move the header include out from _WIN32 and under the specific HAVE_UTIME_H check.
Diffstat (limited to 'sim/sh')
-rw-r--r--sim/sh/interp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index ce4d6cd..c1b05dd 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -45,8 +45,10 @@
#endif
#include <time.h>
#include <sys/time.h>
-#ifndef _WIN32
+#ifdef HAVE_UTIME_H
#include <utime.h>
+#endif
+#ifndef _WIN32
#include <sys/wait.h>
#endif
@@ -1024,7 +1026,12 @@ trap (SIM_DESC sd, int i, int *regs, unsigned char *insn_ptr,
int len = strswaplen (regs[5]);
strnswap (regs[5], len);
+#ifdef HAVE_UTIME_H
regs[0] = utime (ptr (regs[5]), (void *) ptr (regs[6]));
+#else
+ errno = ENOSYS;
+ regs[0] = -1;
+#endif
strnswap (regs[5], len);
break;
}