diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-19 09:08:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-19 09:08:23 +0000 |
commit | ea5679c9794da8c807462fcc1f31c9763efcfb61 (patch) | |
tree | e1aaadc9fd24c627eb66b8683a6452a04f65c490 | |
parent | 23d081b993746ffe47d2f42266e4b7856f2450c3 (diff) | |
download | ruby-ea5679c9794da8c807462fcc1f31c9763efcfb61.tar.gz |
* win32/win32.c, win32/win32.h: fixed prototypes.
* win32/win32.c (wait): same as waitpid() with -1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | win32/win32.c | 37 | ||||
-rw-r--r-- | win32/win32.h | 13 |
3 files changed, 30 insertions, 34 deletions
@@ -1,6 +1,12 @@ +Thu Feb 19 18:08:18 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * win32/win32.c, win32/win32.h: fixed prototypes. + + * win32/win32.c (wait): same as waitpid() with -1. + Thu Feb 19 02:34:28 2004 Dave Thomas <dave@pragprog.com> - * lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::include_file): + * lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::include_file): Only strip comment markers if all lines start with comments. Thu Feb 19 03:05:49 2004 Minero Aoki <aamine@loveruby.net> @@ -34,7 +40,7 @@ Wed Feb 19 00:20:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au> Thu Feb 19 00:11:05 2004 Dave Thomas <dave@pragprog.com> - * lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::handle): + * lib/rdoc/markup/simple_markup/preprocess.rb (SM::PreProcess::handle): Strip extraneous space from filenames in :include: Wed Feb 18 22:53:41 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> @@ -154,8 +160,8 @@ Mon Feb 16 22:22:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au> * lib/rinda/rinda.rb: added documentation (from Hugh Sasse) * lib/rinda/tuplespace.rb: ditto - - [Note: rinda files actually committed Wed Feb 18 07:27:00 2004] + + [Note: rinda files actually committed Wed Feb 18 07:27:00 2004] Mon Feb 16 20:28:52 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> diff --git a/win32/win32.c b/win32/win32.c index 7eea4b76b0..99907cc682 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -88,7 +88,7 @@ bool NtSyncProcess = TRUE; -static struct ChildRecord *CreateChild(char *, char *, SECURITY_ATTRIBUTES *, HANDLE, HANDLE, HANDLE); +static struct ChildRecord *CreateChild(const char *, const char *, SECURITY_ATTRIBUTES *, HANDLE, HANDLE, HANDLE); static int make_cmdvector(const char *, char ***); static bool has_redirection(const char *); static void StartSockets (); @@ -590,10 +590,10 @@ rb_w32_get_osfhandle(int fh) } int -rb_w32_argv_size(argv) - char **argv; +rb_w32_argv_size(char *const *argv) { - char *p, **t; + const char *p; + char *const *t; int len, n, bs, quote; for (t = argv, len = 0; *t; t++) { @@ -621,11 +621,10 @@ rb_w32_argv_size(argv) } char * -rb_w32_join_argv(cmd, argv) - char *cmd; - char **argv; +rb_w32_join_argv(char *cmd, char *const *argv) { - char *p, *q, *s, **t; + const char *p, *s; + char *q, *const *t; int n, bs, quote; for (t = argv, q = cmd; p = *t; t++) { @@ -661,7 +660,7 @@ rb_w32_join_argv(cmd, argv) } pid_t -rb_w32_pipe_exec(char *cmd, char *prog, int mode, FILE **fpr, FILE **fpw) +rb_w32_pipe_exec(const char *cmd, const char *prog, int mode, FILE **fpr, FILE **fpw) { struct ChildRecord* child; HANDLE hReadIn, hReadOut; @@ -800,10 +799,7 @@ rb_w32_pipe_exec(char *cmd, char *prog, int mode, FILE **fpr, FILE **fpw) extern VALUE rb_last_status; int -rb_w32_spawn(mode, cmd, prog) -int mode; -char *cmd; -char *prog; +rb_w32_spawn(int mode, const char *cmd, const char *prog) { struct ChildRecord *child; DWORD exitcode; @@ -840,10 +836,7 @@ char *prog; } int -rb_w32_aspawn(mode, prog, argv) -int mode; -char *prog; -char **argv; +rb_w32_aspawn(int mode, const char *prog, char *const *argv) { int len = rb_w32_argv_size(argv); char *cmd = ALLOCA_N(char, len); @@ -852,14 +845,14 @@ char **argv; } static struct ChildRecord * -CreateChild(char *cmd, char *prog, SECURITY_ATTRIBUTES *psa, HANDLE hInput, HANDLE hOutput, HANDLE hError) +CreateChild(const char *cmd, const char *prog, SECURITY_ATTRIBUTES *psa, HANDLE hInput, HANDLE hOutput, HANDLE hError) { BOOL fRet; DWORD dwCreationFlags; STARTUPINFO aStartupInfo; PROCESS_INFORMATION aProcessInformation; SECURITY_ATTRIBUTES sa; - char *shell; + const char *shell; struct ChildRecord *child; if (!cmd && !prog) { @@ -932,7 +925,7 @@ CreateChild(char *cmd, char *prog, SECURITY_ATTRIBUTES *psa, HANDLE hInput, HAND } RUBY_CRITICAL({ - fRet = CreateProcess(shell, cmd, psa, psa, + fRet = CreateProcess(shell, (char *)cmd, psa, psa, psa->bInheritHandle, dwCreationFlags, NULL, NULL, &aStartupInfo, &aProcessInformation); errno = map_errno(GetLastError()); @@ -2616,9 +2609,9 @@ link(const char *from, const char *to) } int -wait() +wait(int *status) { - return 0; + return waitpid(-1, status, 0); } char * diff --git a/win32/win32.h b/win32/win32.h index ed930ae6b9..cbe24a414c 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -128,11 +128,8 @@ struct timezone { int tz_dsttime; }; #endif -extern int NtMakeCmdVector(char *, char ***, int); extern void NtInitialize(int *, char ***); -extern char * NtGetLib(void); -extern char * NtGetBin(void); -extern pid_t pipe_exec(char *, int, FILE **, FILE **); +extern pid_t rb_w32_pipe_exec(const char *, const char *, int, FILE **, FILE **); extern int flock(int fd, int oper); extern int rb_w32_accept(int, struct sockaddr *, int *); extern int rb_w32_bind(int, struct sockaddr *, int); @@ -175,10 +172,10 @@ extern int chown(const char *, int, int); extern int link(const char *, const char *); extern int gettimeofday(struct timeval *, struct timezone *); extern pid_t waitpid (pid_t, int *, int); -extern int rb_w32_argv_size(char **); -extern char *rb_w32_join_argv(char *, char **); -extern int rb_w32_spawn(int, char *, char*); -extern int rb_w32_aspawn(int, char *, char **); +extern int rb_w32_argv_size(char *const *); +extern char *rb_w32_join_argv(char *, char *const *); +extern int rb_w32_spawn(int, const char *, const char*); +extern int rb_w32_aspawn(int, const char *, char *const *); extern int kill(int, int); extern pid_t rb_w32_getpid(void); |