From 19f57ce1443f309c726aef8e5316efde1dfece8e Mon Sep 17 00:00:00 2001 From: eban Date: Wed, 8 Dec 2004 11:14:53 +0000 Subject: [PATCH] * process.c (rb_spawn): support for DJGPP. * lib/mkmf.rb (VPATH): specify the implicit path separator for DJGPP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/mkmf.rb | 3 +++ process.c | 8 +++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7a4118871..3a8e80da96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 8 20:13:06 2004 WATANABE Hirofumi + + * process.c (rb_spawn): support for DJGPP. + + * lib/mkmf.rb (VPATH): specify the implicit path separator for DJGPP. + Wed Dec 8 17:37:33 2004 NAKAMURA Usaku * win32/win32.c (rb_w32_pipe_exec): need to close original socket diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 8b04299322..2e2da375f4 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -733,6 +733,9 @@ def configuration(srcdir) if !CROSS_COMPILING && CONFIG['build_os'] == 'cygwin' && CONFIG['target_os'] != 'cygwin' vpath.each {|p| p.sub!(/.*/, '$(shell cygpath -u \&)')} end + if !CROSS_COMPILING && CONFIG['build_os'] == 'msdosdjgpp' + CONFIG['PATH_SEPARATOR'] = ';' + end mk << %{ SHELL = /bin/sh diff --git a/process.c b/process.c index c40e75f810..f3b8426f6d 100644 --- a/process.c +++ b/process.c @@ -600,7 +600,7 @@ rb_waitpid(pid, st, flags) goto retry; } #else /* NO_WAITPID */ - if (pid_tbl && st_lookup(pid_tbl, pid, st)) { + if (pid_tbl && st_lookup(pid_tbl, pid, (st_data_t *)st)) { last_status_set(*st, pid); st_delete(pid_tbl, (st_data_t*)&pid, NULL); return pid; @@ -626,7 +626,7 @@ rb_waitpid(pid, st, flags) } if (!pid_tbl) pid_tbl = st_init_numtable(); - st_insert(pid_tbl, pid, st); + st_insert(pid_tbl, pid, (st_data_t)st); if (!rb_thread_alone()) rb_thread_schedule(); } #endif @@ -1141,6 +1141,7 @@ proc_spawn_v(argv, prog) #endif before_exec(); status = spawnv(P_WAIT, prog, argv); + last_status_set(status == -1 ? 127 : status, 0); after_exec(); return status; #endif @@ -1181,6 +1182,7 @@ proc_spawn(str) char *shell = dln_find_exe("sh", 0); before_exec(); status = shell?spawnl(P_WAIT,shell,"sh","-c",str,(char*)NULL):system(str); + last_status_set(status == -1 ? 127 : status, 0); after_exec(); return status; } @@ -1597,7 +1599,7 @@ rb_spawn(argc, argv) if (prog && argc) argv[0] = prog; #else if (prog && argc) argv[0] = prog; - prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" ")); + if (argc) prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" ")); status = system(StringValuePtr(prog)); # if defined(__human68k__) || defined(__DJGPP__) last_status_set(status == -1 ? 127 : status, 0);