[GRASS-SVN] r55337 - grass/trunk/db/db.select

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 12 11:19:40 PDT 2013


Author: mmetz
Date: 2013-03-12 11:19:40 -0700 (Tue, 12 Mar 2013)
New Revision: 55337

Modified:
   grass/trunk/db/db.select/main.c
Log:
db.select: do not use ERROR

Modified: grass/trunk/db/db.select/main.c
===================================================================
--- grass/trunk/db/db.select/main.c	2013-03-12 18:01:24 UTC (rev 55336)
+++ grass/trunk/db/db.select/main.c	2013-03-12 18:19:40 UTC (rev 55337)
@@ -85,8 +85,8 @@
 	stat = sel(driver, &stmt);
     }
     else { /* -> parms.input */
-        stat = OK;
-        while (stat == OK && get_stmt(fd, &stmt)) {
+        stat = DB_OK;
+        while (stat == DB_OK && get_stmt(fd, &stmt)) {
             if (!stmt_is_empty(&stmt))
                 stat = sel(driver, &stmt);
         }
@@ -98,7 +98,7 @@
     db_close_database(driver);
     db_shutdown_driver(driver);
 
-    exit(stat == OK ? EXIT_SUCCESS : EXIT_FAILURE);
+    exit(stat == DB_OK ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
 
@@ -113,9 +113,9 @@
     int more;
 
     if (db_open_select_cursor(driver, stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
-	return ERROR;
+	return DB_FAILED;
     if (parms.test_only)
-	return OK;
+	return DB_OK;
 
     table = db_get_cursor_table(&cursor);
     ncols = db_get_table_number_of_columns(table);
@@ -125,7 +125,7 @@
 	    print_column_definition(column);
 	}
 
-	return OK;
+	return DB_OK;
     }
 
     if (parms.output && strcmp(parms.output, "-") != 0) { 
@@ -150,7 +150,7 @@
     /* fetch the data */
     while (TRUE) {
 	if (db_fetch(&cursor, DB_NEXT, &more) != DB_OK)
-	    return ERROR;
+	    return DB_FAILED;
 	if (!more)
 	    break;
 
@@ -175,7 +175,7 @@
 	    fprintf(stdout, "%s\n", parms.vs);
     }
 
-    return OK;
+    return DB_OK;
 }
 
 



More information about the grass-commit mailing list