diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 897e9604b0..cf34d74189 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2392,6 +2392,15 @@ private: int AutoSaveBuffer::generateChild() { +#if defined(__APPLE__) + /* FIXME fork() is not usable for autosave on Mac OS X 10.6 (snow leopard) + * We should 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) + */ + pid_t const pid = -1; +#else // tmp_ret will be located (usually) in /tmp // will that be a problem? // Note that this calls ForkedCalls::fork(), so it's @@ -2401,6 +2410,7 @@ int AutoSaveBuffer::generateChild() // you should set pid to -1, and comment out the fork. if (pid != 0 && pid != -1) return pid; +#endif // pid = -1 signifies that lyx was unable // to fork. But we will do the save diff --git a/src/support/ForkedCalls.cpp b/src/support/ForkedCalls.cpp index 0768652cfb..496008e0d1 100644 --- a/src/support/ForkedCalls.cpp +++ b/src/support/ForkedCalls.cpp @@ -150,7 +150,7 @@ int ForkedProcess::run(Starttype type) bool ForkedProcess::running() const { - if (!pid()) + if (pid() <= 0) return false; #if !defined (_WIN32) @@ -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; } diff --git a/status.16x b/status.16x index bc4df06056..5f86a8d018 100644 --- a/status.16x +++ b/status.16x @@ -215,6 +215,8 @@ What's new - Fix width definition in the box dialog after a box inset was transformed from "Inner Box" type "None" to "Parbox" or "Minipage" (bug 6298). +- Fix crash with autosave on Mac OS X 10.6 (bug 6168). + - Fixed problem involving inability to turn off auto-save (bug 6227). - Sort document classes case insensitively (bug 1492).