mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 21:05:12 +00:00
revert previous fix for Snow Leopard crashes and apply new one
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32067 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1545219dcb
commit
3f22ae8f1d
@ -2964,6 +2964,15 @@ private:
|
|||||||
|
|
||||||
int AutoSaveBuffer::generateChild()
|
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
|
// tmp_ret will be located (usually) in /tmp
|
||||||
// will that be a problem?
|
// will that be a problem?
|
||||||
// Note that this calls ForkedCalls::fork(), so it's
|
// Note that this calls ForkedCalls::fork(), so it's
|
||||||
@ -2973,6 +2982,7 @@ int AutoSaveBuffer::generateChild()
|
|||||||
// you should set pid to -1, and comment out the fork.
|
// you should set pid to -1, and comment out the fork.
|
||||||
if (pid != 0 && pid != -1)
|
if (pid != 0 && pid != -1)
|
||||||
return pid;
|
return pid;
|
||||||
|
#endif
|
||||||
|
|
||||||
// pid = -1 signifies that lyx was unable
|
// pid = -1 signifies that lyx was unable
|
||||||
// to fork. But we will do the save
|
// to fork. But we will do the save
|
||||||
|
@ -150,7 +150,7 @@ int ForkedProcess::run(Starttype type)
|
|||||||
|
|
||||||
bool ForkedProcess::running() const
|
bool ForkedProcess::running() const
|
||||||
{
|
{
|
||||||
if (!pid())
|
if (pid() <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if !defined (_WIN32)
|
#if !defined (_WIN32)
|
||||||
@ -170,7 +170,7 @@ bool ForkedProcess::running() const
|
|||||||
void ForkedProcess::kill(int tol)
|
void ForkedProcess::kill(int tol)
|
||||||
{
|
{
|
||||||
lyxerr << "ForkedProcess::kill(" << tol << ')' << endl;
|
lyxerr << "ForkedProcess::kill(" << tol << ')' << endl;
|
||||||
if (pid() == 0) {
|
if (pid() <= 0) {
|
||||||
lyxerr << "Can't kill non-existent process!" << endl;
|
lyxerr << "Can't kill non-existent process!" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -192,13 +192,7 @@ void ForkedProcess::kill(int tol)
|
|||||||
|
|
||||||
|
|
||||||
pid_t ForkedProcess::fork() {
|
pid_t ForkedProcess::fork() {
|
||||||
/* FIXME fork() is not usable on Mac OS X 10.6 (snow leopard)
|
#if !defined (HAVE_FORK)
|
||||||
* 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;
|
return -1;
|
||||||
#else
|
#else
|
||||||
pid_t pid = ::fork();
|
pid_t pid = ::fork();
|
||||||
|
Loading…
Reference in New Issue
Block a user