summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--win32/win32.c10
-rw-r--r--win32/win32.h3
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e5b584a..afe7e69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 11 17:47:17 2002 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, win32/win32.h (rb_w32_getpid): negate pid under Win9x.
+ [ruby-dev:18262]
+
Wed Sep 11 12:58:57 2002 Akinori MUSHA <knu@iDaemons.org>
* string.c (get_pat): Add an extra argument "quote".
diff --git a/win32/win32.c b/win32/win32.c
index d33d023..72bf940 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2917,3 +2917,13 @@ void rb_w32_free_environ(char **env)
while (*t) free(*t++);
free(env);
}
+
+pid_t rb_w32_getpid(void)
+{
+ pid_t pid;
+
+ pid = _getpid();
+ if (IsWin95()) pid = -pid;
+
+ return pid;
+}
diff --git a/win32/win32.h b/win32/win32.h
index 95a6e4d..136706a 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -141,7 +141,7 @@ extern "C++" {
#define umask _umask
#define unlink _unlink
#define write _write
-#define getpid _getpid
+#define getpid rb_w32_getpid
#define sleep(x) rb_w32_sleep((x)*1000)
#define utime _utime
#define vsnprintf _vsnprintf
@@ -201,6 +201,7 @@ extern int gettimeofday(struct timeval *, struct timezone *);
extern pid_t waitpid (pid_t, int *, int);
extern int do_spawn(char *);
extern int kill(int, int);
+extern pid_t rb_w32_getpid(void);
#ifndef __BORLANDC__
extern int isinf(double);
extern int isnan(double);