Jean-Marc Lasgouttes <lasgout...@lyx.org> writes:
> This is pretty bad. But note that it is considered as pretty rude from a
> modern OS to just die because of an application it does not like. Is it
> fix with the recent 10.6.2 OS X update?

I suspect that OSX dies when we kill a process with pid==-1 %-|

Bennett, could you try this new patch?

JMarc

svndiff src/support/

Index: src/support/ForkedCalls.cpp
===================================================================
--- src/support/ForkedCalls.cpp	(révision 31917)
+++ src/support/ForkedCalls.cpp	(copie de travail)
@@ -170,7 +170,7 @@ bool ForkedProcess::running() const
 void ForkedProcess::kill(int tol)
 {
 	lyxerr << "ForkedProcess::kill(" << tol << ')' << endl;
-	if (pid() == 0) {
+	if (pid() <= 0) {
 		lyxerr << "Can't kill non-existent process!" << endl;
 		return;
 	}
@@ -192,7 +192,13 @@ void ForkedProcess::kill(int tol)
 
 
 pid_t ForkedProcess::fork() {
-#if !defined (HAVE_FORK)
+/* FIXME fork() is not usable on Mac OS X 10.6 (snow leopard) 
+ *   Use something else like threads.
+ *
+ * Since I do not know how to determine at run time what is the OS X
+ * version, I just disable forking altogether for now (JMarc)
+ */
+#if !defined (HAVE_FORK) || defined(__APPLE__)
 	return -1;
 #else
 	pid_t pid = ::fork();

Reply via email to