[Pkg-privacy-commits] [nautilus-wipe] 02/37: Fix signal re-emission

Intrigeri intrigeri at moszumanska.debian.org
Wed Dec 7 18:46:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch master
in repository nautilus-wipe.

commit 23c31ef6508c39a5790fa3ed37927099043613ca
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Tue Jul 12 17:39:25 2016 +0200

    Fix signal re-emission
    
    g_signal_emit_by_name() do not take a separate detail argument, we only
    have been lucky it worked for progress report.  This was only because
    the x86-64 calling convention passes doubles in different registers
    than integers and pointers, so as the erroneous extra argument was an
    integer it didn't conflict on x86-64.
    
    However, the one for the "finished" signal was just broken, as the
    arguments (no doubles) were offset by one (on x86-64, probably worse on
    stack-based architectures), leading to the "success" parameter being
    interpreted as the "message" one.
    It might however not have been too problematic in practice, because the
    erroneous extra leading argument was `0`, which also was the only
    possible value of the `success` variable used as second argument.  As
    0 is a proper NULL pointer, the call may have been equivalent to
    `(..., FALSE, NULL)`, which, although not the expected arguments here
    (second one should likely not be `NULL`), is a valid argument list for
    the signal (`message` argument is allowed to be `NULL`).
    This might even also apply to stack-based calling convention if the
    sizes and offset of integers and pointer are compatible, which is not
    unlikely.
    
    Anyway, remove the erroneous extra leading argument fixing all this
    craziness.
---
 nautilus-wipe/nw-fill-operation.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nautilus-wipe/nw-fill-operation.c b/nautilus-wipe/nw-fill-operation.c
index 34ab892..9107dd9 100644
--- a/nautilus-wipe/nw-fill-operation.c
+++ b/nautilus-wipe/nw-fill-operation.c
@@ -156,7 +156,7 @@ nw_fill_operation_progress_handler (GsdFillOperation *operation,
    * recursively, we block our handler during the re-emission */
   g_signal_stop_emission_by_name (operation, "progress");
   g_signal_handler_block (operation, self->priv->progress_hid);
-  g_signal_emit_by_name (operation, "progress", 0,
+  g_signal_emit_by_name (operation, "progress",
                          (self->priv->n_op_done + fraction) / self->priv->n_op);
   g_signal_handler_unblock (operation, self->priv->progress_hid);
 }
@@ -179,7 +179,7 @@ launch_next_operation (NwFillOperation *self)
                                       &err);
     if (! success) {
       g_signal_handler_block (self, self->priv->finished_hid);
-      g_signal_emit_by_name (self, "finished", 0, success, err->message);
+      g_signal_emit_by_name (self, "finished", success, err->message);
       g_signal_handler_unblock (self, self->priv->finished_hid);
       g_error_free (err);
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/nautilus-wipe.git



More information about the Pkg-privacy-commits mailing list