summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-05-06 15:24:59 +0000
committerGuido van Rossum <guido@python.org>1997-05-06 15:24:59 +0000
commitd8a19fda832558354d24e43a7b4848aae85ff774 (patch)
tree9353070fea76efde3a2672f84de0483f9ac67979 /Python/pythonrun.c
parentafc69ced7d230e2d6e043a30e8105422b7f7a4fc (diff)
downloadcpython-d8a19fda832558354d24e43a7b4848aae85ff774.tar.gz
Keep MS compiler happy: use (int)strlen() when comparing; make sure
not to use kill().
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index f08a2c4a6e..8bb7565fb6 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -57,6 +57,12 @@ PERFORMANCE OF THIS SOFTWARE.
#include "windows.h"
#endif
+#ifdef HAVE_GETPID
+#ifndef MS_WINDOWS
+#define HAVE_KILL
+#endif
+#endif
+
extern char *Py_GetPath();
extern grammar _PyParser_Grammar; /* From graminit.c */
@@ -370,7 +376,7 @@ PyErr_Print()
if (text != NULL) {
char *nl;
if (offset > 0 &&
- offset == strlen(text))
+ offset == (int)strlen(text))
offset--;
for (;;) {
nl = strchr(text, '\n');
@@ -728,7 +734,7 @@ sighandler(sig)
{
signal(sig, SIG_DFL); /* Don't catch recursive signals */
Py_Cleanup(); /* Do essential clean-up */
-#ifdef HAVE_GETPID
+#ifdef HAVE_KILL
kill(getpid(), sig); /* Pretend the signal killed us */
#else
exit(1);