summaryrefslogtreecommitdiff
path: root/mate-screenshot/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-01-04 02:32:05 +0100
committerPablo Barciela <[email protected]>2018-01-04 02:32:05 +0100
commit0167ba40cdab5e75ba14653d7d0a5afef5ee53c6 (patch)
treedf867da34bbda81492a372b639e4ad29b6324711 /mate-screenshot/src
parent773be33efb397d245fe26cdbc4e0f9a45ecc1adc (diff)
downloadmate-utils-0167ba40cdab5e75ba14653d7d0a5afef5ee53c6.tar.bz2
mate-utils-0167ba40cdab5e75ba14653d7d0a5afef5ee53c6.tar.xz
screenshot-save.c: Fix build warnings with ‘pipe’ ‘write’ and ‘read’:
ignoring return value declared with attribute warn_unused_result
Diffstat (limited to 'mate-screenshot/src')
-rw-r--r--mate-screenshot/src/screenshot-save.c21
1 files 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);