- g_io_channel_unref (data->error_channel);
- g_string_free (data->error_string, TRUE);
- close (data->error_fd);
- g_spawn_close_pid (pid);
- g_free (data);
-}
-
-static gboolean
-eject_mount_read_error (GIOChannel *channel,
- GIOCondition condition,
- gpointer user_data)
-{
- EjectMountOp *data = user_data;
- char buf[BUFSIZ];
- gsize bytes_read;
- GError *error;
- GIOStatus status;
-
- error = NULL;
-read:
- status = g_io_channel_read_chars (channel, buf, sizeof (buf), &bytes_read, &error);
- if (status == G_IO_STATUS_NORMAL)
- {
- g_string_append_len (data->error_string, buf, bytes_read);
- if (bytes_read == sizeof (buf))
- goto read;
- }
- else if (status == G_IO_STATUS_EOF)
- g_string_append_len (data->error_string, buf, bytes_read);
- else if (status == G_IO_STATUS_ERROR)