Skip to content

Commit

Permalink
Remove redundant checks of g_io_channel_flush return value
Browse files Browse the repository at this point in the history
  • Loading branch information
keremet committed Jan 7, 2025
1 parent a90448c commit d910015
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions debugger/src/dbm_gdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ static GList* read_until_prompt(void)
*/
static void gdb_input_write_line(const gchar *line)
{
GIOStatus st;
GError *err = NULL;
gsize count;
const char *p;
Expand All @@ -232,7 +231,7 @@ static void gdb_input_write_line(const gchar *line)

for (p = command; *p; p += count)
{
st = g_io_channel_write_chars(gdb_ch_in, p, strlen(p), &count, &err);
GIOStatus st = g_io_channel_write_chars(gdb_ch_in, p, strlen(p), &count, &err);
if (err || (st == G_IO_STATUS_ERROR) || (st == G_IO_STATUS_EOF))
{
if (err)
Expand All @@ -246,16 +245,13 @@ static void gdb_input_write_line(const gchar *line)
}
}

st = g_io_channel_flush(gdb_ch_in, &err);
if (err || (st == G_IO_STATUS_ERROR) || (st == G_IO_STATUS_EOF))
g_io_channel_flush(gdb_ch_in, &err);
if (err)
{
if (err)
{
#ifdef DEBUG_OUTPUT
dbg_cbs->send_message(err->message, "red");
dbg_cbs->send_message(err->message, "red");
#endif
g_clear_error(&err);
}
g_clear_error(&err);
}
}

Expand Down

0 comments on commit d910015

Please sign in to comment.