mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-capture: Drop GError usage from SysprofCaptureWriter
Use `errno` instead, which is icky, but given that all of the failure modes are from POSIX I/O functions, it’s at least in keeping with them. This is a major API break. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #40
This commit is contained in:
@ -198,7 +198,8 @@ sysprof_local_profiler_finish_stopping (SysprofLocalProfiler *self)
|
||||
g_assert (priv->is_stopping == TRUE);
|
||||
g_assert (priv->stopping->len == 0);
|
||||
|
||||
reader = sysprof_capture_writer_create_reader (priv->writer, 0);
|
||||
reader = sysprof_capture_writer_create_reader (priv->writer);
|
||||
g_assert (reader != NULL);
|
||||
|
||||
for (guint i = 0; i < priv->sources->len; i++)
|
||||
{
|
||||
|
||||
@ -450,12 +450,11 @@ sysprof_proxy_source_cat (SysprofProxySource *self,
|
||||
g_assert (SYSPROF_IS_PROXY_SOURCE (self));
|
||||
g_assert (reader != NULL);
|
||||
|
||||
if (self->writer != NULL)
|
||||
if (self->writer != NULL &&
|
||||
!sysprof_capture_writer_cat (self->writer, reader))
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!sysprof_capture_writer_cat (self->writer, reader, &error))
|
||||
g_warning ("Failed to join reader: %s\n", error->message);
|
||||
int errsv = errno;
|
||||
g_warning ("Failed to join reader: %s", g_strerror (errsv));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -259,8 +259,9 @@ sysprof_tracefd_source_stop (SysprofSource *source)
|
||||
{
|
||||
g_autoptr(SysprofCaptureReader) reader = NULL;
|
||||
|
||||
/* FIXME: Error handling is ignored here */
|
||||
if ((reader = sysprof_capture_reader_new_from_fd (priv->tracefd)))
|
||||
sysprof_capture_writer_cat (priv->writer, reader, NULL);
|
||||
sysprof_capture_writer_cat (priv->writer, reader);
|
||||
|
||||
priv->tracefd = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user