summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-18 06:59:36 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-18 06:59:36 +0000
commit3d6fde336547463461180b9be5b1730194764d9c (patch)
treec268af56267dcc487f65cec821380293b37f4749 /win32
parentf0886df4a4d017ed3655b1e1a4a4df2ebaa8c71e (diff)
2000-02-18
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/config.h7
-rw-r--r--win32/win32.c15
-rw-r--r--win32/win32.h5
3 files changed, 18 insertions, 9 deletions
diff --git a/win32/config.h b/win32/config.h
index fe550654c22..b1a2d8d0d98 100644
--- a/win32/config.h
+++ b/win32/config.h
@@ -40,10 +40,11 @@
#define FILE_COUNT _cnt
#define DLEXT ".dll"
#define RUBY_LIB "/usr/local/lib/ruby/1.5"
-#define RUBY_ARCHLIB "/usr/local/lib/ruby/1.5/i386-mswin32"
-#define RUBY_SITE_LIB "/usr/local/lib/ruby/1.5/site_ruby"
-#define RUBY_SITE_ARCHLIB "/usr/local/lib/ruby/1.5/site_ruby/i386-mswin32"
+#define RUBY_SITE_LIB "/usr/local/lib/ruby/site_ruby"
+#define RUBY_SITE_LIB2 "/usr/local/lib/ruby/site_ruby/1.5"
#define RUBY_PLATFORM "i386-mswin32"
+#define RUBY_ARCHLIB "/usr/local/lib/ruby/1.5/i386-mswin32"
+#define RUBY_SITE_ARCHLIB "/usr/local/lib/ruby/site_ruby/1.5/i386-mswin32"
#define SIZEOF_INT 4
#define SIZEOF_SHORT 2
diff --git a/win32/win32.c b/win32/win32.c
index 877978db587..a1e6d25ff3b 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -546,15 +546,14 @@ mypopen (char *cmd, char *mode)
if (lpCmd2)
free(lpCmd2);
- CloseHandle(aProcessInformation.hThread);
-
if (!fRet) {
CloseHandle(hInFile);
CloseHandle(hOutFile);
- CloseHandle(aProcessInformation.hProcess);
return NULL;
}
+ CloseHandle(aProcessInformation.hThread);
+
if (reading) {
fd = _open_osfhandle((long)hInFile, (_O_RDONLY | pipemode));
CloseHandle(hOutFile);
@@ -1541,7 +1540,7 @@ typedef struct {
#endif /* defined (_MT) && !defined (DLL_FOR_WIN32S) */
} ioinfo;
-EXTERN_C ioinfo * __pioinfo[];
+EXTERN_C _CRTIMP ioinfo * __pioinfo[];
#define IOINFO_L2E 5
#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
@@ -1549,6 +1548,7 @@ EXTERN_C ioinfo * __pioinfo[];
#define _osfile(i) (_pioinfo(i)->osfile)
#define FOPEN 0x01 /* file handle open */
+#define FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */
#define FAPPEND 0x20 /* file handle opened O_APPEND */
#define FDEV 0x40 /* file handle refers to device */
#define FTEXT 0x80 /* file handle is in text mode */
@@ -1568,6 +1568,9 @@ my_open_osfhandle(long osfhandle, int flags)
if (flags & O_TEXT)
fileflags |= FTEXT;
+ if (flags & O_NOINHERIT)
+ fileflags |= FNOINHERIT;
+
/* attempt to allocate a C Runtime file handle */
if ((fh = _alloc_osfhnd()) == -1) {
errno = EMFILE; /* too many open files */
@@ -2203,7 +2206,7 @@ gettimeofday(struct timeval *tv, struct timezone *tz)
}
char *
-getcwd(buffer, size)
+win32_getcwd(buffer, size)
char *buffer;
int size;
{
@@ -2218,7 +2221,7 @@ getcwd(buffer, size)
return NULL;
}
- for (bp = buffer; *bp != '\0'; bp++) {
+ for (bp = buffer; *bp != '\0'; bp = CharNext(bp)) {
if (*bp == '\\') {
*bp = '/';
}
diff --git a/win32/win32.h b/win32/win32.h
index a55641eada3..cbcf4e8117e 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -387,6 +387,11 @@ extern char *mystrerror(int);
#endif
#define get_osfhandle myget_osfhandle
+#ifdef getcwd
+#undef getcwd
+#endif
+#define getcwd win32_getcwd
+
#ifdef getenv
#undef getenv
#endif