[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 05/27: Provide `kill' only if supported by the host
From: |
Andy Wingo |
Subject: |
[Guile-commits] 05/27: Provide `kill' only if supported by the host |
Date: |
Mon, 25 Jul 2016 09:53:45 +0000 (UTC) |
wingo pushed a commit to branch master
in repository guile.
commit a1cb59c47e04a7c135d4a75401c351da8df4eb8f
Author: Andy Wingo <address@hidden>
Date: Mon Jul 11 22:17:09 2016 +0200
Provide `kill' only if supported by the host
* libguile/posix.c (scm_kill): Only provide if the host has `kill'. An
incompatible change on MinGW, where this function would work only if
the PID was the current PID, but that will be fixed by the next
process.
---
libguile/posix.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/libguile/posix.c b/libguile/posix.c
index dfb5bf9..452b9e3 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -626,6 +626,7 @@ SCM_DEFINE (scm_setrlimit, "setrlimit", 3, 0, 0,
#endif /* HAVE_GETRLIMIT */
+#ifdef HAVE_KILL
SCM_DEFINE (scm_kill, "kill", 2, 0, 0,
(SCM pid, SCM sig),
"Sends a signal to the specified process or group of processes.\n\n"
@@ -653,30 +654,12 @@ SCM_DEFINE (scm_kill, "kill", 2, 0, 0,
#define FUNC_NAME s_scm_kill
{
/* Signal values are interned in scm_init_posix(). */
-#ifdef HAVE_KILL
if (kill (scm_to_int (pid), scm_to_int (sig)) != 0)
SCM_SYSERROR;
-#else
- /* Mingw has raise(), but not kill(). (Other raw DOS environments might
- be similar.) Use raise() when the requested pid is our own process,
- otherwise bomb. */
- if (scm_to_int (pid) == getpid ())
- {
- if (raise (scm_to_int (sig)) != 0)
- {
- err:
- SCM_SYSERROR;
- }
- else
- {
- errno = ENOSYS;
- goto err;
- }
- }
-#endif
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
+#endif
#ifdef HAVE_WAITPID
SCM_DEFINE (scm_waitpid, "waitpid", 1, 1, 0,
- [Guile-commits] branch master updated (867316f -> d2684fe), Andy Wingo, 2016/07/25
- [Guile-commits] 01/27: build: Remove unneeded check for 'unsetenv'., Andy Wingo, 2016/07/25
- [Guile-commits] 02/27: Unconditionally include <time.h> from Gnulib., Andy Wingo, 2016/07/25
- [Guile-commits] 09/27: Ignore meta/build-env, Andy Wingo, 2016/07/25
- [Guile-commits] 03/27: Add missing 'const' qualifier., Andy Wingo, 2016/07/25
- [Guile-commits] 05/27: Provide `kill' only if supported by the host,
Andy Wingo <=
- [Guile-commits] 27/27: Avoid compilation warnings about alloca in read.c, Andy Wingo, 2016/07/25
- [Guile-commits] 04/27: More robust setuid, setgid, etc detection, Andy Wingo, 2016/07/25
- [Guile-commits] 17/27: doc: Do not gender the programmer., Andy Wingo, 2016/07/25
- [Guile-commits] 24/27: Use non-deprecated HAVE_STRUCT_TM_TM_ZONE, Andy Wingo, 2016/07/25
- [Guile-commits] 07/27: More specific status:exit-val et al compilation guards, Andy Wingo, 2016/07/25
- [Guile-commits] 12/27: Add popen feature, Andy Wingo, 2016/07/25
- [Guile-commits] 10/27: Rename win32-uname.[ch] to posix-w32.[ch], Andy Wingo, 2016/07/25
- [Guile-commits] 16/27: Update uname implementation in posix-w32, Andy Wingo, 2016/07/25
- [Guile-commits] 22/27: Gnulib: Add dirname-lgpl., Andy Wingo, 2016/07/25
- [Guile-commits] 14/27: Fix MinGW build error, Andy Wingo, 2016/07/25