[Momonga-devel.ja:00734] Re: merging gcc3 to HEAD (Re: GCC3 の今後)


小松です。

From: Kenta MURATA <muraken2@xxxxxxxxx>
Subject: [Momonga-devel.ja:00733] Re: merging gcc3 to HEAD (Re:  GCC3 の今後)
Date: Thu, Nov 07, 2002 at 12:01:21PM JST

> > どうなんでしょう.今、exec_command で呼び出してる system を 
> > exec に変更してやってみたところ,defunct になってるのは rpmb 
> > のプロセスでした.
> 
> 説明が足りなかったので補足します.いや,変更個所を貼ります(爆
  (以下略)

やっぱり pipe のところがアヤシイと思ったので、
pipe 関係をすべて comment out してみたところ
問題なく omokon で build できました。

でも、これだと OmoiKondara.log ができなくて困ると思ったので
pipe の代わりに popen とか使ってみたら、
これも問題なく build できてしまいました。。。

なんかわけわからんけど、patch つけとくので試して下さい。


Index: OmoiKondara
===================================================================
RCS file: /home/cvs/tools/OmoiKondara,v
retrieving revision 1.60
diff -u -r1.60 OmoiKondara
--- OmoiKondara	2002/10/22 15:57:51	1.60
+++ OmoiKondara	2002/11/07 17:00:46
@@ -167,34 +167,14 @@
 #        fCMD = open ("|#{cmd}", "r")
 #      end
       begin
-        pipe = IO.pipe
-        pid = Process.fork do
-          pipe[0].close
-          begin
-            pipe[1].sync = true
-            $stdout.reopen(pipe[1])
-            $stderr.reopen(pipe[1]) unless cmd =~ /gcc\.spec/
-            status = system(cmd) ? 0 : 1
-            #exec(cmd)
-          rescue => e
-            p e
-            status = 1
-          ensure
-#            p "exec_command: status = #{status}"
-            pipe[1].close
-#            p "exec_command: ahi"
-          end
-          exit!(status)
-        end
-        pipe[1].close
-        while s = pipe[0].gets do
-          print s if $VERBOSEOUT
-          fLOG.print s
-        end
-        Process.waitpid2(pid)
+        pipe = IO.popen(cmd) do |io|
+	  while s = io.gets do
+	    print s if $VERBOSEOUT
+	    fLOG.print s
+	  end
+	end
       ensure
         status = $?
-        pipe[0].close
       end
 #      while s = fCMD.gets
 #        print s if $VERBOSEOUT

-- 
---------------------------------------
東京大学大学院総合文化研究科
広域科学専攻相関基礎科学系 
  佐々研究室  博士3年
    小松  晋一朗            
koma2@xxxxxxxxxxxxxxxxxxxx
koma2@xxxxxxxxxxxxxxxxx
http://kamuy.c.u-tokyo.ac.jp/~koma2/
---------------------------------------