From 4b6fd7d022e006a1309d60b1a044b0f0fec28ef0 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 3 Aug 2010 14:44:03 +0200 Subject: [PATCH] =?utf8?q?Dirty=20hack:=20Test=20"L=C3=A4uft=20OO=3F"=20er?= =?utf8?q?folgreich,=20wenn=20Testscript=20"1"=20ausgibt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Grund: OpenOffice bzw. der UNO-Connector stürzt gerne beim Beenden mit einem segmentation fault ab, auch wenn die Verbindung selber in Ordnung war. Also zusätzlich zum Exit code eine Statusausgabe des Scripts benutzen. --- SL/Template.pm | 9 +++++---- scripts/oo-uno-test-conn.py | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SL/Template.pm b/SL/Template.pm index 24285bf5b..a21f9eae3 100644 --- a/SL/Template.pm +++ b/SL/Template.pm @@ -1251,10 +1251,11 @@ sub spawn_xvfb { sub is_openoffice_running { $main::lxdebug->enter_sub(); - system("./scripts/oo-uno-test-conn.py $main::openofficeorg_daemon_port " . - "> /dev/null 2> /dev/null"); - my $res = $? == 0; - $main::lxdebug->message(LXDebug->DEBUG2(), " is_openoffice_running(): $?\n"); + my $output = `./scripts/oo-uno-test-conn.py $main::openofficeorg_daemon_port 2> /dev/null`; + chomp $output; + + my $res = ($? == 0) || $output; + $main::lxdebug->message(LXDebug->DEBUG2(), " is_openoffice_running(): res $res\n"); $main::lxdebug->leave_sub(); diff --git a/scripts/oo-uno-test-conn.py b/scripts/oo-uno-test-conn.py index 183a290e2..5b7203ae9 100755 --- a/scripts/oo-uno-test-conn.py +++ b/scripts/oo-uno-test-conn.py @@ -26,7 +26,10 @@ def main(): try: desktop = establish_connection(sys.argv[1]) except: + print "0" sys.exit(2) + + print "1" sys.exit(0) main() -- 2.20.1