From patchwork Wed Aug 1 21:33:42 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Helin X-Patchwork-Id: 12497 Received: from nf-out-0910.google.com ([64.233.182.186]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1IGLpC-00069K-P1 for vdr@linuxtv.org; Wed, 01 Aug 2007 23:33:46 +0200 Received: by nf-out-0910.google.com with SMTP id d21so114321nfb for ; Wed, 01 Aug 2007 14:33:45 -0700 (PDT) Received: by 10.86.62.3 with SMTP id k3mr868427fga.1186004024571; Wed, 01 Aug 2007 14:33:44 -0700 (PDT) Received: from ?192.168.1.110? ( [82.181.26.61]) by mx.google.com with ESMTPS id p9sm2397114fkb.2007.08.01.14.33.43 (version=SSLv3 cipher=RC4-MD5); Wed, 01 Aug 2007 14:33:43 -0700 (PDT) Message-ID: <46B0FC36.5040708@googlemail.com> Date: Thu, 02 Aug 2007 00:33:42 +0300 From: Petri Helin User-Agent: Thunderbird 2.0.0.5 (X11/20070716) MIME-Version: 1.0 To: vdr@linuxtv.org Subject: [vdr] New shutdown procedure not working as expected X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2007 21:33:48 -0000 Status: O X-Status: X-Keywords: X-UID: 13628 Hi, It seems that the new shutdown procedure introduced for versions 1.5.x is (at least for me) not working as expected. The problem is that it does not recognize correctly whether VDR was started manually or not. In fact it thinks every time that it has been started manually. I traced the problem to the SystemExec call in cShutdownHandler::CallShutdownCommand where Setup.NextWakeupTime is updated only if the SystemExec call returns 0. i changed it to accept all values greater or equal to 0 and now Setup.NextWakeupTime gets updated properly. Can some explain me why 0 is expected? Here is the patch that I came up with: for comparison on reboot } -Petri --- shutdown.c.orig 2007-08-02 00:14:49.000000000 +0300 +++ shutdown.c 2007-08-02 00:15:10.000000000 +0300 @@ -126,7 +126,7 @@ time_t Delta = WakeupTime ? WakeupTime - time(NULL) : 0; cString cmd = cString::sprintf("%s %ld %ld %d \"%s\" %d", shutdownCommand, WakeupTime, Delta, Channel, *strescape(File, "\"$"), UserShutdown); isyslog("executing '%s'", *cmd); - if (SystemExec(cmd, true) == 0) + if (SystemExec(cmd, true) >= 0) Setup.NextWakeupTime = WakeupTime; // Remember this wakeup time