[evolution-data-server/openismus-work] e-test-server-utils.c: Use g_spawn_command_line_sync() instead of g_spawn_sync()



commit 9c46cf570a44ec98e7ea4d7c9bf2da57d79a3b2c
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Thu Jan 31 16:55:44 2013 +0900

    e-test-server-utils.c: Use g_spawn_command_line_sync() instead of g_spawn_sync()
    
    In some cases the previous statement was failing with "directory not empty"
    for the 'rm -rf' call issued, my hope is that using g_spawn_command_line_sync()
    will properly pass the '-rf' arguments to /bin/rm.

 tests/test-server-utils/e-test-server-utils.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/tests/test-server-utils/e-test-server-utils.c b/tests/test-server-utils/e-test-server-utils.c
index fd72781..05de61c 100644
--- a/tests/test-server-utils/e-test-server-utils.c
+++ b/tests/test-server-utils/e-test-server-utils.c
@@ -67,13 +67,15 @@ delete_work_directory (void)
 	 * corrupting our contained D-Bus environment with service files
 	 * from the OS.
 	 */
-	const gchar *argv[] = { "/bin/rm", "-rf", EDS_TEST_WORK_DIR, NULL };
+	gchar *cmdline;
 	gboolean spawn_succeeded;
 	gint exit_status;
 
-	spawn_succeeded = g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL,
-	                                NULL, NULL, &exit_status, NULL);
+	cmdline = g_strdup_printf ("rm -rf %s", EDS_TEST_WORK_DIR);
 
+	spawn_succeeded = g_spawn_command_line_sync (cmdline, NULL, NULL, &exit_status, NULL);
+
+	g_free (cmdline);
 	g_assert (spawn_succeeded);
 	g_assert (WIFEXITED (exit_status));
 	g_assert_cmpint (WEXITSTATUS (exit_status), ==, 0);



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