sim: callback: add check for HAVE_KILL
authorMike Frysinger <vapier@gentoo.org>
Tue, 29 Jun 2021 07:13:54 +0000 (03:13 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 30 Jun 2021 00:12:57 +0000 (20:12 -0400)
Fix building on systems w/out a kill function (e.g. Windows).

sim/common/ChangeLog
sim/common/callback.c

index 7b21b00c880e7736ced7fd03179695d6e31828df..da6511c89c97cd5c06aa76a4aac6be2f0d0ab5f2 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-29  Mike Frysinger  <vapier@gentoo.org>
+
+       * callback.c [!HAVE_KILL] (os_kill): Return ENOSYS.
+
 2021-06-29  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-model.c (model_option_handler): Make machp const.
index f773de1c19f0dbfa6ec17f782611a237d1ea844e..39d068c4866f9d8d106fd85b3a1cb344ee9617bd 100644 (file)
@@ -544,11 +544,16 @@ os_getpid (host_callback *p)
 static int
 os_kill (host_callback *p, int pid, int signum)
 {
+#ifdef HAVE_KILL
   int result;
 
   result = kill (pid, signum);
   p->last_errno = errno;
   return result;
+#else
+  p->last_errno = ENOSYS;
+  return -1;
+#endif
 }
 
 static int
This page took 0.028982 seconds and 4 git commands to generate.