summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-01-12 16:29:56 +0100
committerPablo Barciela <[email protected]>2018-01-12 16:29:56 +0100
commit13532afba1d8dfd77038b2607e3a68a15a23970c (patch)
tree18c80774359472fabf8f2dd0960f1f9c357641a5
parent172e05f957cfcf4b94c469f9b0933ce414faaf8a (diff)
downloadmate-control-center-13532afba1d8dfd77038b2607e3a68a15a23970c.tar.bz2
mate-control-center-13532afba1d8dfd77038b2607e3a68a15a23970c.tar.xz
theme-thumbnail.c: Fix build warnings with ‘write’ and ‘pipe’:
ignoring return value declared with attribute warn_unused_result
-rw-r--r--capplets/common/theme-thumbnail.c72
1 files changed, 55 insertions, 17 deletions
diff --git a/capplets/common/theme-thumbnail.c b/capplets/common/theme-thumbnail.c
index 4fb96402..a3111374 100644
--- a/capplets/common/theme-thumbnail.c
+++ b/capplets/common/theme-thumbnail.c
@@ -593,12 +593,17 @@ message_from_capplet (GIOChannel *source,
}
/* Write the pixbuf's size */
- write (pipe_from_factory_fd[1], &width, sizeof (width));
- write (pipe_from_factory_fd[1], &height, sizeof (height));
+
+ if (write (pipe_from_factory_fd[1], &width, sizeof (width)) == -1)
+ perror ("write error");
+
+ if (write (pipe_from_factory_fd[1], &height, sizeof (height)) == -1)
+ perror ("write error");
for (i = 0; i < height; i++)
{
- write (pipe_from_factory_fd[1], pixels + rowstride * i, width * gdk_pixbuf_get_n_channels (pixbuf));
+ if (write (pipe_from_factory_fd[1], pixels + rowstride * i, width * gdk_pixbuf_get_n_channels (pixbuf)) == -1)
+ perror ("write error");
}
if (pixbuf)
@@ -761,33 +766,63 @@ send_thumbnail_request (gchar *thumbnail_type,
gchar *icon_theme_name,
gchar *application_font)
{
- write (pipe_to_factory_fd[1], thumbnail_type, strlen (thumbnail_type) + 1);
+ if (write (pipe_to_factory_fd[1], thumbnail_type, strlen (thumbnail_type) + 1) == -1)
+ perror ("write error");
if (gtk_theme_name)
- write (pipe_to_factory_fd[1], gtk_theme_name, strlen (gtk_theme_name) + 1);
+ {
+ if (write (pipe_to_factory_fd[1], gtk_theme_name, strlen (gtk_theme_name) + 1) == -1)
+ perror ("write error");
+ }
else
- write (pipe_to_factory_fd[1], "", 1);
+ {
+ if (write (pipe_to_factory_fd[1], "", 1) == -1)
+ perror ("write error");
+ }
if (gtk_color_scheme)
- write (pipe_to_factory_fd[1], gtk_color_scheme, strlen (gtk_color_scheme) + 1);
+ {
+ if (write (pipe_to_factory_fd[1], gtk_color_scheme, strlen (gtk_color_scheme) + 1) == -1)
+ perror ("write error");
+ }
else
- write (pipe_to_factory_fd[1], "", 1);
+ {
+ if (write (pipe_to_factory_fd[1], "", 1) == -1)
+ perror ("write error");
+ }
if (marco_theme_name)
- write (pipe_to_factory_fd[1], marco_theme_name, strlen (marco_theme_name) + 1);
+ {
+ if (write (pipe_to_factory_fd[1], marco_theme_name, strlen (marco_theme_name) + 1) == -1)
+ perror ("write error");
+ }
else
- write (pipe_to_factory_fd[1], "", 1);
+ {
+ if (write (pipe_to_factory_fd[1], "", 1) == -1)
+ perror ("write error");
+ }
if (icon_theme_name)
- write (pipe_to_factory_fd[1], icon_theme_name, strlen (icon_theme_name) + 1);
+ {
+ if (write (pipe_to_factory_fd[1], icon_theme_name, strlen (icon_theme_name) + 1) == -1)
+ perror ("write error");
+ }
else
- write (pipe_to_factory_fd[1], "", 1);
+ {
+ if (write (pipe_to_factory_fd[1], "", 1) == -1)
+ perror ("write error");
+ }
if (application_font)
- write (pipe_to_factory_fd[1], application_font, strlen (application_font) + 1);
+ {
+ if (write (pipe_to_factory_fd[1], application_font, strlen (application_font) + 1) == -1)
+ perror ("write error");
+ }
else
- write (pipe_to_factory_fd[1], "Sans 10", strlen ("Sans 10") + 1);
-
+ {
+ if (write (pipe_to_factory_fd[1], "Sans 10", strlen ("Sans 10") + 1) == -1)
+ perror ("write error");
+ }
}
static GdkPixbuf *
@@ -1032,8 +1067,11 @@ theme_thumbnail_factory_init (int argc, char *argv[])
gint child_pid;
#endif
- pipe (pipe_to_factory_fd);
- pipe (pipe_from_factory_fd);
+ if (pipe (pipe_to_factory_fd) == -1)
+ perror ("pipe error");
+
+ if (pipe (pipe_from_factory_fd) == -1)
+ perror ("pipe error");
/* Apple's CoreFoundation classes must not be used from forked
* processes. Since freetype (and thus GTK) uses them, we simply