[grilo/mocking: 27/27] net: Don't capture while mocking is enabled



commit 30f90a6365c485daedc25b9e2ae8fc97436f0c96
Author: Mathias Hasselmann <mathias openismus com>
Date:   Mon Oct 22 18:27:03 2012 +0200

    net: Don't capture while mocking is enabled

 libs/net/grl-net-private.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libs/net/grl-net-private.c b/libs/net/grl-net-private.c
index c157f9b..257dce5 100644
--- a/libs/net/grl-net-private.c
+++ b/libs/net/grl-net-private.c
@@ -101,6 +101,12 @@ init_dump_directory ()
 {
   capture_dir = g_getenv (GRL_NET_CAPTURE_DIR_VAR);
 
+  if (capture_dir && is_mocked ()) {
+    GRL_WARNING ("Cannot capture while mocking is enabled.");
+    capture_dir = NULL;
+    return;
+  }
+
   if (capture_dir && g_mkdir_with_parents (capture_dir, 0700)) {
     GRL_WARNING ("Could not create capture directory \"%s\": %s",
                  capture_dir, g_strerror (errno));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]