Skip to content

Commit

Permalink
Fix some warn_unused_result warnings
Browse files Browse the repository at this point in the history
While building on gcc 9.3.0
  • Loading branch information
ericcurtin authored and mwleeds committed Oct 12, 2021
1 parent 6ebe331 commit c6845ad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 14 additions & 2 deletions common/flatpak-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -8060,13 +8060,25 @@ flatpak_get_cursor_pos (int * row, int *col)
void
flatpak_hide_cursor (void)
{
write (STDOUT_FILENO, FLATPAK_ANSI_HIDE_CURSOR, strlen (FLATPAK_ANSI_HIDE_CURSOR));
const size_t flatpak_hide_cursor_len = strlen (FLATPAK_ANSI_HIDE_CURSOR);
const ssize_t write_ret = write (STDOUT_FILENO, FLATPAK_ANSI_HIDE_CURSOR,
flatpak_hide_cursor_len);

if (write_ret < 0)
g_warning ("write() failed: %zd = write(STDOUT_FILENO, FLATPAK_ANSI_HIDE_CURSOR, %zu)",
write_ret, flatpak_hide_cursor_len);
}

void
flatpak_show_cursor (void)
{
write (STDOUT_FILENO, FLATPAK_ANSI_SHOW_CURSOR, strlen (FLATPAK_ANSI_SHOW_CURSOR));
const size_t flatpak_show_cursor_len = strlen (FLATPAK_ANSI_SHOW_CURSOR);
const ssize_t write_ret = write (STDOUT_FILENO, FLATPAK_ANSI_SHOW_CURSOR,
flatpak_show_cursor_len);

if (write_ret < 0)
g_warning ("write() failed: %zd = write(STDOUT_FILENO, FLATPAK_ANSI_SHOW_CURSOR, %zu)",
write_ret, flatpak_show_cursor_len);
}

void
Expand Down
6 changes: 5 additions & 1 deletion revokefs/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ main (int argc, char *argv[])
}

g_print ("Started revokefs, press enter to revoke");
fgets(buf, sizeof(buf), stdin);
if (!fgets(buf, sizeof(buf), stdin))
{
perror ("fgets");
}

g_print ("Revoking write permissions");
shutdown (sockets[1], SHUT_RDWR);
}

0 comments on commit c6845ad

Please sign in to comment.