public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: callback: add check for HAVE_KILL
@ 2021-06-29  7:16 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-06-29  7:16 UTC (permalink / raw)
  To: gdb-patches

Fix building on systems w/out a kill function (e.g. Windows).
---
 sim/common/callback.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sim/common/callback.c b/sim/common/callback.c
index f773de1c19f0..39d068c4866f 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -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
-- 
2.31.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-29  7:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  7:16 [PATCH] sim: callback: add check for HAVE_KILL Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).