[Openvas-commits] r5425 - in trunk/openvas-client: . openvas/prefs_dialog

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 7 12:31:20 CEST 2009


Author: mattm
Date: 2009-10-07 12:31:15 +0200 (Wed, 07 Oct 2009)
New Revision: 5425

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/openvas/prefs_dialog/prefs_scope_tree.c
Log:
	* openvas/prefs_dialog/prefs_scope_tree.c (create_omp_scope): Convert
	NULL returns to ints.  Use show_error instead of show_error_and_wait.
	Add missing success return.  Put the final g_free in an else.

Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-10-07 07:01:34 UTC (rev 5424)
+++ trunk/openvas-client/ChangeLog	2009-10-07 10:31:15 UTC (rev 5425)
@@ -1,3 +1,9 @@
+2009-10-07  Matthew Mundell <matthew.mundell at intevation.de>
+
+	* openvas/prefs_dialog/prefs_scope_tree.c (create_omp_scope): Convert
+	NULL returns to ints.  Use show_error instead of show_error_and_wait.
+	Add missing success return.  Put the final g_free in an else.
+
 2009-10-06  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
 
 	* openvas/prefs_dialog/prefs_scope_tree.c (scope_menu_save): Renamed

Modified: trunk/openvas-client/openvas/prefs_dialog/prefs_scope_tree.c
===================================================================
--- trunk/openvas-client/openvas/prefs_dialog/prefs_scope_tree.c	2009-10-07 07:01:34 UTC (rev 5424)
+++ trunk/openvas-client/openvas/prefs_dialog/prefs_scope_tree.c	2009-10-07 10:31:15 UTC (rev 5425)
@@ -1049,34 +1049,37 @@
         pwd = open (".", O_RDONLY);
         if (pwd == -1)
           {
-            show_error_and_wait (_("%s: failed to open current directory"),
-                                 __FUNCTION__);
-            return NULL;
+            show_error (_("%s: failed to open current directory"),
+                        __FUNCTION__);
+            return -6;
           }
 
         if (chdir (*scope_dir_name))
           {
-            show_error_and_wait (_("%s: failed to chdir to %s"),
-                                 context->dir,
-                                 __FUNCTION__);
-            return NULL;
+            show_error (_("%s: failed to chdir to %s"),
+                        context->dir,
+                        __FUNCTION__);
+            return -6;
           }
 
         if (symlink ("../openvas_nvt_cache", "openvas_nvt_cache"))
           {
-            show_error_and_wait (_("%s: failed to symlink to parent NVT cache"),
-                                 __FUNCTION__);
-            return NULL;
+            show_error (_("%s: failed to symlink to parent NVT cache"),
+                        __FUNCTION__);
+            return -6;
           }
 
         if (fchdir (pwd))
-          show_error_and_wait (_("%s: failed to fchdir back to previous dir"),
-                               __FUNCTION__);
+          show_error (_("%s: failed to fchdir back to previous dir"),
+                      __FUNCTION__);
 
         close (pwd);
+
+        return 0;
       }
     }
-  g_free (servers_dir_name);
+  else
+    g_free (servers_dir_name);
 
   show_error (_("%s: check_is_dir"), __FUNCTION__);
   return -1;



More information about the Openvas-commits mailing list