Ver código fonte

db.select: do not use ERROR

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55337 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 anos atrás
pai
commit
fc6ea732ce
1 arquivos alterados com 8 adições e 8 exclusões
  1. 8 8
      db/db.select/main.c

+ 8 - 8
db/db.select/main.c

@@ -85,8 +85,8 @@ int main(int argc, char **argv)
 	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 @@ int main(int argc, char **argv)
     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 sel(dbDriver * driver, dbString * stmt)
     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 @@ int sel(dbDriver * driver, dbString * stmt)
 	    print_column_definition(column);
 	}
 
-	return OK;
+	return DB_OK;
     }
 
     if (parms.output && strcmp(parms.output, "-") != 0) { 
@@ -150,7 +150,7 @@ int sel(dbDriver * driver, dbString * stmt)
     /* 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 @@ int sel(dbDriver * driver, dbString * stmt)
 	    fprintf(stdout, "%s\n", parms.vs);
     }
 
-    return OK;
+    return DB_OK;
 }