From 0167ba40cdab5e75ba14653d7d0a5afef5ee53c6 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Thu, 4 Jan 2018 02:32:05 +0100 Subject: =?UTF-8?q?screenshot-save.c:=20Fix=20build=20warnings=20with=20?= =?UTF-8?q?=E2=80=98pipe=E2=80=99=20=E2=80=98write=E2=80=99=20and=20?= =?UTF-8?q?=E2=80=98read=E2=80=99:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ignoring return value declared with attribute warn_unused_result --- mate-screenshot/src/screenshot-save.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mate-screenshot/src/screenshot-save.c b/mate-screenshot/src/screenshot-save.c index a26b16ae..414fe285 100644 --- a/mate-screenshot/src/screenshot-save.c +++ b/mate-screenshot/src/screenshot-save.c @@ -185,8 +185,11 @@ screenshot_save_start (GdkPixbuf *pixbuf, int parent_exit_notification[2]; int pipe_from_child[2]; - pipe (parent_exit_notification); - pipe (pipe_from_child); + if (pipe (parent_exit_notification) == -1) + perror("pipe error"); + + if (pipe (pipe_from_child) == -1) + perror("pipe error"); parent_dir = make_temp_directory (); if (parent_dir == NULL) @@ -216,19 +219,19 @@ screenshot_save_start (GdkPixbuf *pixbuf, NULL)) { if (error && error->message) - write (pipe_from_child[1], - error->message, - strlen (error->message)); + if (write (pipe_from_child[1], error->message, strlen (error->message)) == -1) + perror("write error"); else #define ERROR_MESSAGE _("Unknown error saving screenshot to disk") - write (pipe_from_child[1], - ERROR_MESSAGE, - strlen (ERROR_MESSAGE)); + if (write (pipe_from_child[1], ERROR_MESSAGE, strlen (ERROR_MESSAGE)) == -1) + perror("write error"); } /* By closing the pipe, we let the main process know that we're * done saving it. */ close (pipe_from_child[1]); - read (parent_exit_notification[0], &c, 1); + + if (read (parent_exit_notification[0], &c, 1) == -1) + perror("read error"); clean_up_temporary_dir (FALSE); _exit (0); -- cgit v1.2.1