From 80dc652115e275a95b05bb6809825cc324d9475a Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Tue, 3 Apr 2007 11:42:43 -0400 Subject: add a glib message to syslog handler Also add ability to toggle debugging when SIGUSR1 is received. --- src/ck-job.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/ck-job.c') diff --git a/src/ck-job.c b/src/ck-job.c index 44e9a57..1093629 100644 --- a/src/ck-job.c +++ b/src/ck-job.c @@ -34,7 +34,6 @@ #include #include "ck-job.h" -#include "ck-debug.h" #include "ck-marshal.h" #define CK_JOB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CK_TYPE_JOB, CkJobPrivate)) @@ -87,7 +86,7 @@ wait_on_child (int pid) } else if (errno == ECHILD) { ; /* do nothing, child already reaped */ } else { - ck_debug ("waitpid () should not fail"); + g_debug ("waitpid () should not fail"); } } @@ -116,7 +115,7 @@ maybe_complete_job (CkJob *job) status = wait_on_job (job); - ck_debug ("Emitting completed"); + g_debug ("Emitting completed"); g_signal_emit (job, signals [COMPLETED], 0, status); } } @@ -138,7 +137,7 @@ error_watch (GIOChannel *source, switch (status) { case G_IO_STATUS_NORMAL: - ck_debug ("command error output: %s", line); + g_debug ("command error output: %s", line); g_string_append (job->priv->stderr, line); break; case G_IO_STATUS_EOF: @@ -146,7 +145,7 @@ error_watch (GIOChannel *source, break; case G_IO_STATUS_ERROR: finished = TRUE; - ck_debug ("Error reading from child: %s\n", error->message); + g_debug ("Error reading from child: %s\n", error->message); break; case G_IO_STATUS_AGAIN: default: @@ -183,7 +182,7 @@ out_watch (GIOChannel *source, switch (status) { case G_IO_STATUS_NORMAL: - ck_debug ("command output: %s", line); + g_debug ("command output: %s", line); g_string_append (job->priv->stdout, line); break; case G_IO_STATUS_EOF: @@ -191,7 +190,7 @@ out_watch (GIOChannel *source, break; case G_IO_STATUS_ERROR: finished = TRUE; - ck_debug ("Error reading from child: %s\n", error->message); + g_debug ("Error reading from child: %s\n", error->message); break; case G_IO_STATUS_AGAIN: default: @@ -223,10 +222,10 @@ ck_job_execute (CkJob *job, int argc; char **argv; - ck_debug ("Executing %s", job->priv->command); + g_debug ("Executing %s", job->priv->command); local_error = NULL; if (! g_shell_parse_argv (job->priv->command, &argc, &argv, &local_error)) { - ck_debug ("Could not parse command: %s", local_error->message); + g_debug ("Could not parse command: %s", local_error->message); g_propagate_error (error, local_error); return FALSE; } @@ -246,7 +245,7 @@ ck_job_execute (CkJob *job, g_strfreev (argv); if (! res) { - ck_debug ("Could not start command '%s': %s", + g_debug ("Could not start command '%s': %s", job->priv->command, local_error->message); g_propagate_error (error, local_error); @@ -357,7 +356,7 @@ ck_job_finalize (GObject *object) { CkJob *job; - ck_debug ("Finalizing job"); + g_debug ("Finalizing job"); g_return_if_fail (object != NULL); g_return_if_fail (CK_IS_JOB (object)); -- cgit