[En-Nut-Discussion] More verbose error output for nutconfigure when conf bnot found

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Oct 5 18:37:57 CEST 2009


Hello,

if the .conf file is not found, no verbose output was given.

Bye

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: nut/tools/nutconf/nutcomponent.c
===================================================================
--- nut/tools/nutconf/nutcomponent.c	(Revision 2740)
+++ nut/tools/nutconf/nutcomponent.c	(Arbeitskopie)
@@ -1941,9 +1941,14 @@
     int rc;
     lua_State *ls = (lua_State *)(repo->nr_ls);
 
-    if(ls == NULL || root == NULL || pathname == NULL || access(pathname, 0)) {
+    if(ls == NULL || root == NULL || pathname == NULL ) {
         return -1;
     }
+    if(access(pathname, 0)) {
+        sprintf(errtxt, "Failed to access %s", pathname);
+        errsts++;
+	return -1;
+    }
 
     /* Let the interpreter load the script file. */
     if ((rc = luaL_loadfile(ls, pathname)) != 0) {



More information about the En-Nut-Discussion mailing list