[前][次][番号順一覧][スレッド一覧]

ruby-changes:7722

From: usa <ko1@a...>
Date: Mon, 8 Sep 2008 18:17:49 +0900 (JST)
Subject: [ruby-changes:7722] Ruby:r19243 (trunk): * win32/win32.c (getppid): typo.

usa	2008-09-08 18:17:22 +0900 (Mon, 08 Sep 2008)

  New Revision: 19243

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19243

  Log:
    * win32/win32.c (getppid): typo. [ruby-dev:36202]
    
    * process.c (get_ppid): mention the return value on Windows.

  Modified files:
    trunk/ChangeLog
    trunk/process.c
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19242)
+++ ChangeLog	(revision 19243)
@@ -1,3 +1,9 @@
+Mon Sep  8 18:13:20 2008  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (getppid): typo. [ruby-dev:36202]
+
+	* process.c (get_ppid): mention the return value on Windows.
+
 Mon Sep  8 18:15:59 2008  Tanaka Akira  <akr@f...>
 
 	* tool/transcode-tblgen.rb (ArrayCode): less string substitutions.
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 19242)
+++ win32/win32.c	(revision 19243)
@@ -3965,23 +3965,23 @@
 	    HANDLE hNtDll = GetModuleHandle("ntdll.dll");
 	    if (hNtDll) {
 		pNtQueryInformationProcess = (long (WINAPI *)(HANDLE, int, void *, ULONG, ULONG *))GetProcAddress(hNtDll, "NtQueryInformationProcess");
-		if (pNtQueryInformationProcess) {
-		    struct {
-			long ExitStatus;
-			void* PebBaseAddress;
-			ULONG AffinityMask;
-			ULONG BasePriority;
-			ULONG UniqueProcessId;
-			ULONG ParentProcessId;
-		    } pbi;
-		    ULONG len;
-		    long ret = pNtQueryInformationProcess(GetCurrentProcess(), 0, &pbi, sizeof(pbi), &len);
-		    if (!ret) {
-			ppid = pbi.ParentProcessId;
-		    }
-		}
 	    }
 	}
+	if (pNtQueryInformationProcess) {
+	    struct {
+		long ExitStatus;
+		void* PebBaseAddress;
+		ULONG AffinityMask;
+		ULONG BasePriority;
+		ULONG UniqueProcessId;
+		ULONG ParentProcessId;
+	    } pbi;
+	    ULONG len;
+	    long ret = pNtQueryInformationProcess(GetCurrentProcess(), 0, &pbi, sizeof(pbi), &len);
+	    if (!ret) {
+		ppid = pbi.ParentProcessId;
+	    }
+	}
     }
 
     return ppid;
Index: process.c
===================================================================
--- process.c	(revision 19242)
+++ process.c	(revision 19243)
@@ -162,8 +162,8 @@
  *  call-seq:
  *     Process.ppid   => fixnum
  *
- *  Returns the process id of the parent of this process. Always
- *  returns 0 on NT. Not available on all platforms.
+ *  Returns the process id of the parent of this process. Returns
+ *  untrustworthy value on Win32/64. Not available on all platforms.
  *
  *     puts "I am #{Process.pid}"
  *     Process.fork { puts "Dad is #{Process.ppid}" }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]