* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "config.h"
-
#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
#include <stdlib.h>
#include <glib.h>
+#ifdef G_OS_UNIX
+#include <unistd.h>
+#endif
+
#ifdef G_OS_WIN32
#include <windows.h>
#endif
char *argv0;
#endif
-GPid
+static GPid
get_a_child (gint ttl)
{
GPid pid;
#endif /* G_OS_WIN32 */
}
-gboolean
+static gboolean
child_watch_callback (GPid pid, gint status, gpointer data)
{
#ifdef VERBOSE
exit (STILL_ACTIVE);
}
#endif
- /* Only run the test, if threads are enabled and a default thread
- * implementation is available.
- */
-#if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
-#ifdef TEST_THREAD
- g_thread_init (NULL);
-#endif
+
main_loop = g_main_loop_new (NULL, FALSE);
#ifdef G_OS_WIN32
#endif
alive = 2;
- g_timeout_add (30000, quit_loop, main_loop);
+ g_timeout_add_seconds (30, quit_loop, main_loop);
#ifdef TEST_THREAD
g_thread_create (test_thread, GINT_TO_POINTER (10), FALSE, NULL);
g_main_loop_run (main_loop);
+ g_main_loop_unref (main_loop);
+
if (alive > 0)
{
g_warning ("%d children still alive\n", alive);
return 1;
}
-#endif
return 0;
}