[Pkg-privacy-commits] [libgsecuredelete] 76/168: Remove watch_interval argument from run() methods

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 20:06:41 UTC 2016


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

u-guest pushed a commit to branch master
in repository libgsecuredelete.

commit c40dd36c680d41f5ba2a0b7bb576b8518d285af9
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Sat Apr 30 03:44:44 2011 +0200

    Remove watch_interval argument from run() methods
    
    This is an implementation details, and it may change if we switch to
    e.g. GChildWatch/GIOCondition at some point.
---
 gsecuredelete/async-operation.vala        | 13 +++++++------
 gsecuredelete/fill-operation.vala         |  6 ++----
 gsecuredelete/main.vala                   |  2 +-
 gsecuredelete/securedelete-operation.vala |  5 ++---
 gsecuredelete/swap-operation.vala         |  6 ++----
 5 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/gsecuredelete/async-operation.vala b/gsecuredelete/async-operation.vala
index 7357419..1bf2b64 100644
--- a/gsecuredelete/async-operation.vala
+++ b/gsecuredelete/async-operation.vala
@@ -19,6 +19,11 @@
 
 using GLib;
 
+/* interval (in milliseconds) between two checks for subprocess' status.
+ * A too short value may use too much CPU and a too long may be less
+ * responsive. */
+private const uint WATCH_INTERVAL = 100;
+
 namespace Gsd
 {
   /**
@@ -342,15 +347,11 @@ namespace Gsd
      *    null to use the parent's one.
      * @param spawn_flags SpawnFlags. You may only use the SEARCH_PATH and
      *    CHILD_INHERITS_STDIN flags, others may conflict.
-     * @param watch_interval time (in milliseconds) between two check for
-     *    subprocess' status. A too short value may use too much CPU and a too
-     *    big may be less responsive.
      * 
      * @return whether asynchronous operation was successfully started.
      */
     public bool run (string?    working_directory = null,
-                     SpawnFlags spawn_flags = 0,
-                     uint       watch_interval = 100)
+                     SpawnFlags spawn_flags = 0)
       throws SpawnError, AsyncOperationError
     {
       bool success = false;
@@ -374,7 +375,7 @@ namespace Gsd
           out this.pid, out this.fd_in, out this.fd_out, out this.fd_err
         );
         if (success) {
-          Timeout.add (watch_interval, this.do_wait_child);
+          Timeout.add (WATCH_INTERVAL, this.do_wait_child);
         }
       } finally {
         /* if success is false, an error was thrown and the timeout not added,
diff --git a/gsecuredelete/fill-operation.vala b/gsecuredelete/fill-operation.vala
index a961549..2526eaa 100644
--- a/gsecuredelete/fill-operation.vala
+++ b/gsecuredelete/fill-operation.vala
@@ -118,18 +118,16 @@ namespace Gsd
      * 
      * @param directory the directory to fill. It is exactly the same as setting
      *    the FillOperation:directory property, just a convenience possibility.
-     * @param watch_interval See AsyncOperation.run()
      * 
      * @return whether subprocess started successfully.
      */
-    public new bool run (string? directory = null,
-                         uint watch_interval = 100)
+    public new bool run (string? directory = null)
       throws SpawnError, AsyncOperationError
     {
       if (directory != null) {
         this.directory = directory;
       }
-      return base.run (watch_interval);
+      return base.run ();
     }
     
     /**
diff --git a/gsecuredelete/main.vala b/gsecuredelete/main.vala
index 1797031..44e726d 100644
--- a/gsecuredelete/main.vala
+++ b/gsecuredelete/main.vala
@@ -125,7 +125,7 @@ public class Test
     op.finished.connect (finished_handler);
     op.progress.connect (progress_handler);
     try {
-      op.run (10);
+      op.run ();
       this.main_loop.run ();
     } catch (Error e) {
       stderr.printf ("failed to start deletion: %s\n", e.message);
diff --git a/gsecuredelete/securedelete-operation.vala b/gsecuredelete/securedelete-operation.vala
index f58d4e6..c9935c5 100644
--- a/gsecuredelete/securedelete-operation.vala
+++ b/gsecuredelete/securedelete-operation.vala
@@ -151,13 +151,12 @@ namespace Gsd
     /**
      * Runs a SecureDelete operator asynchronously.
      * 
-     * @param watch_interval See AsyncOperation.run()
      * @return whether operation started successfully.
      */
-    public new bool run (uint watch_interval = 100)
+    public new bool run ()
       throws SpawnError, AsyncOperationError
     {
-      return base.run (null, 0, watch_interval);
+      return base.run (null, 0);
     }
     
     /**
diff --git a/gsecuredelete/swap-operation.vala b/gsecuredelete/swap-operation.vala
index 33737e9..ae67672 100644
--- a/gsecuredelete/swap-operation.vala
+++ b/gsecuredelete/swap-operation.vala
@@ -116,18 +116,16 @@ namespace Gsd
      * 
      * @param device the swap device to wipe. It is exactly the same as setting
      *    the SwapOperation:device property, just a convenience shortcut.
-     * @param watch_interval See AsyncOperation.run()
      * 
      * @return whether subprocess started successfully.
      */
-    public new bool run (string? device = null,
-                         uint watch_interval = 100)
+    public new bool run (string? device = null)
       throws SpawnError, AsyncOperationError
     {
       if (device != null) {
         this.device = device;
       }
-      return base.run (watch_interval);
+      return base.run ();
     }
     
     /**

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



More information about the Pkg-privacy-commits mailing list