root/trunk/mt-testbg.cgi @ 3531

Revision 3531, 0.8 kB (checked in by fumiakiy, 9 months ago)

Merged sockfish to trunk. "svn merge -r3114:3527 http://code.sixapart.com/svn/movabletype/branches/sockfish/ ."

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[1098]1#!/usr/bin/perl -w
2
[3531]3# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd.
[1104]4# This program is distributed under the terms of the
5# GNU General Public License, version 2.
[1098]6#
7# $Id$
8
9use strict;
10
11local $| = 1;
12print "Content-Type: text/html\n\n";
13print "<html>\n<body>\n<pre>\n\n";
14
15eval {
16    local $SIG{__WARN__} = sub { print "**** WARNING: $_[0]\n" };
17
18    my $pid = fork(); 
19    if (defined $pid)
20    {
21        if ($pid) {
22            print wait() > 0
23                   ? "Background tasks are available\n" 
24                   : "Background tasks are not available\n";
25        } else { 
26            sleep 1;
27            exit(0);
28        } 
29    } else { print "Background tasks are not available\n"; }
30};
31print "Got an error: $@" if $@;
32
33print "\n\n</pre>\n</body>\n</html>";
34
Note: See TracBrowser for help on using the browser.