Be verbose here

This commit is contained in:
Yevgen Muntyan 2006-11-16 04:25:37 -06:00
parent fd7fb24adb
commit c303e6ec78
2 changed files with 31 additions and 3 deletions

View File

@ -882,6 +882,10 @@ moo_app_send_files (MooApp *app,
g_return_val_if_fail (MOO_IS_APP (app), FALSE);
_moo_message ("moo_app_send_files: got %d files to pid %s",
files ? g_strv_length (files) : 0,
pid ? pid : "NONE");
msg = g_string_new (NULL);
g_string_append_printf (msg, "%s%08x%08x", CMD_OPEN_URIS, stamp, line);

View File

@ -561,6 +561,7 @@ try_send (const char *tmpdir_name,
GIOStatus status;
gboolean result = FALSE;
char *endptr;
GError *error = NULL;
if (!pid_string[0])
goto out;
@ -575,37 +576,58 @@ try_send (const char *tmpdir_name,
}
filename = g_strdup_printf ("%s/%s%s", tmpdir_name, prefix, pid_string);
_moo_message ("try_send: sending data to pid %s, filename %s", pid_string, filename);
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
{
_moo_message ("try_send: file %s doesn't exist", filename);
goto out;
}
if (kill (pid, 0) != 0)
{
_moo_message ("try_send: no process with pid %d", pid);
unlink (filename);
goto out;
}
chan = g_io_channel_new_file (filename, "w", NULL);
chan = g_io_channel_new_file (filename, "w", &error);
if (!chan)
{
_moo_message ("try_send: could not open %s for writing: %s",
filename, error ? error->message : "<?>");
g_error_free (error);
goto out;
}
g_io_channel_set_encoding (chan, NULL, NULL);
status = g_io_channel_set_flags (chan, G_IO_FLAG_NONBLOCK, NULL);
status = g_io_channel_set_flags (chan, G_IO_FLAG_NONBLOCK, &error);
if (status != G_IO_STATUS_NORMAL)
{
_moo_message ("try_send: could not set NONBLOCK flag: %s",
error ? error->message : "<?>");
goto out;
}
status = g_io_channel_write_chars (chan, data, data_len, NULL, NULL);
status = g_io_channel_write_chars (chan, data, data_len, NULL, &error);
if (status != G_IO_STATUS_NORMAL)
{
_moo_message ("try_send: error writing to pipe: %s",
error ? error->message : "<?>");
goto out;
}
result = TRUE;
_moo_message ("try_send: successfully sent stuff to pid %s", pid_string);
out:
if (chan)
g_io_channel_unref (chan);
if (error)
g_error_free (error);
g_free (filename);
return result;
}
@ -625,6 +647,8 @@ _moo_app_input_send_msg (const char *pipe_basename,
g_return_val_if_fail (pipe_basename != NULL, FALSE);
g_return_val_if_fail (data != NULL, FALSE);
_moo_message ("_moo_app_input_send_msg: sending data to pid %s", pid ? pid : "NONE");
prefix = get_prefix (pipe_basename);
g_return_val_if_fail (prefix != NULL, FALSE);