diff options
author | rbuj <[email protected]> | 2020-11-22 10:21:45 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-11-27 17:47:54 +0100 |
commit | 274ca0c1b8b68eee37205f8faae00295a07b5984 (patch) | |
tree | ad636e4acfe849a55802a496f27b4cbaef800369 | |
parent | e0922b5bff84b4e14685afc01d1747d05c6d8f4b (diff) | |
download | mate-utils-274ca0c1b8b68eee37205f8faae00295a07b5984.tar.bz2 mate-utils-274ca0c1b8b68eee37205f8faae00295a07b5984.tar.xz |
screenshot-save: warning -Wdangling-else
-rw-r--r-- | mate-screenshot/src/screenshot-save.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/mate-screenshot/src/screenshot-save.c b/mate-screenshot/src/screenshot-save.c index 85559ed6..e8417bcd 100644 --- a/mate-screenshot/src/screenshot-save.c +++ b/mate-screenshot/src/screenshot-save.c @@ -178,12 +178,12 @@ signal_handler (int sig) void screenshot_save_start (GdkPixbuf *pixbuf, - SaveFunction callback, - gpointer user_data) + SaveFunction callback, + gpointer user_data) { GPid pid; - int parent_exit_notification[2]; - int pipe_from_child[2]; + int parent_exit_notification[2]; + int pipe_from_child[2]; if (pipe (parent_exit_notification) == -1) perror("pipe error"); @@ -196,8 +196,8 @@ screenshot_save_start (GdkPixbuf *pixbuf, return; tmp_filename = g_build_filename (parent_dir, - _("Screenshot.png"), - NULL); + _("Screenshot.png"), + NULL); save_callback = callback; save_user_data = user_data; @@ -214,18 +214,22 @@ screenshot_save_start (GdkPixbuf *pixbuf, close (pipe_from_child [0]); if (! gdk_pixbuf_save (pixbuf, tmp_filename, - "png", &error, - "tEXt::Software", "mate-screenshot", - NULL)) - { - if (error && error->message) - if (write (pipe_from_child[1], error->message, strlen (error->message)) == -1) - perror("write error"); - else + "png", &error, + "tEXt::Software", "mate-screenshot", + NULL)) + { + if (error && 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") - if (write (pipe_from_child[1], ERROR_MESSAGE, strlen (ERROR_MESSAGE)) == -1) - perror("write error"); - } + 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]); @@ -245,9 +249,9 @@ screenshot_save_start (GdkPixbuf *pixbuf, channel = g_io_channel_unix_new (pipe_from_child[0]); g_io_add_watch (channel, - G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, - read_pipe_from_child, - NULL); + G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, + read_pipe_from_child, + NULL); g_io_channel_unref (channel); g_child_watch_add (pid, child_done_notification, NULL); } |