Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5448

Modified Files:
        Makefile.ag monetdb.c 
Removed Files:
        monetdb_lock.c monetdb_release.c 
Log Message:
move lock and release into monetdb.c again, since they are only simple wrappers

--- monetdb_lock.c DELETED ---

--- monetdb_release.c DELETED ---

U monetdb.c
Index: monetdb.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- monetdb.c   9 Sep 2009 20:13:57 -0000       1.42
+++ monetdb.c   10 Sep 2009 09:17:55 -0000      1.43
@@ -487,8 +487,105 @@
        exit(state);
 }
 
-#include "monetdb_lock.c"
-#include "monetdb_release.c"
+static void
+command_lock(int argc, char *argv[])
+{
+       int i;
+       int state = 0;    /* return status */
+       int hadwork = 0;  /* did we do anything useful? */
+
+       if (argc == 1) {
+               /* print help message for this command */
+               command_help(argc + 1, &argv[-1]);
+               exit(1);
+       }
+
+       /* do for each listed database */
+       for (i = 1; i < argc; i++) {
+               hadwork = 1;
+               if (mero_running == 0) {
+                       char *e;
+
+                       if ((e = db_lock(argv[i])) != NULL) {
+                               fprintf(stderr, "%s: %s\n", argv[0], e);
+                               free(e);
+                               state |= 1;
+                               continue;
+                       }
+               } else {
+                       char *res;
+                       char *out;
+
+                       out = control_send(&res, mero_control, -1, argv[i], 
argv[0]);
+                       if (out != NULL || strcmp(res, "OK") != 0) {
+                               res = out == NULL ? res : out;
+                               fprintf(stderr, "%s: %s\n", argv[0], res);
+                               state |= 1;
+                               free(res);
+                               continue;
+                       }
+                       free(res);
+               }
+               printf("database '%s' is now under maintenance\n", argv[i]);
+       }
+
+       if (hadwork == 0) {
+               command_help(2, &argv[-1]);
+               state |= 1;
+       }
+       exit(state);
+}
+
+static void
+command_release(int argc, char *argv[])
+{
+       int i;
+       int state = 0;    /* return status */
+       int hadwork = 0;  /* did we do anything useful? */
+
+       if (argc == 1) {
+               /* print help message for this command */
+               command_help(argc + 1, &argv[-1]);
+               exit(1);
+       }
+
+       /* do for each listed database */
+       for (i = 1; i < argc; i++) {
+               hadwork = 1;
+               if (mero_running == 0) {
+                       char *e;
+
+                       if ((e = db_release(argv[i])) != NULL) {
+                               fprintf(stderr, "%s: %s\n", argv[0], e);
+                               free(e);
+                               state |= 1;
+                               continue;
+                       }
+               } else {
+                       char *res;
+                       char *out;
+
+                       out = control_send(&res, mero_control, -1, argv[i], 
argv[0]);
+                       if (out != NULL || strcmp(res, "OK") != 0) {
+                               res = out == NULL ? res : out;
+                               fprintf(stderr, "%s: %s\n", argv[0], res);
+                               state |= 1;
+                               free(res);
+                               continue;
+                       }
+                       free(res);
+               }
+               printf("database '%s' has been taken out of maintenance mode\n",
+                               argv[i]);
+       }
+
+       if (hadwork == 0) {
+               command_help(2, &argv[-1]);
+               state |= 1;
+       }
+       exit(state);
+}
+
 
 
 int

U Makefile.ag
Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/Makefile.ag,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Makefile.ag 9 Sep 2009 20:13:57 -0000       1.9
+++ Makefile.ag 10 Sep 2009 09:17:55 -0000      1.10
@@ -35,9 +35,7 @@
 MONETDB_TMP_SUBS = \
        monetdb_discover.c \
        monetdb_get.c \
-       monetdb_lock.c \
        monetdb_merocom.c \
-       monetdb_release.c \
        monetdb_status.c
 
 EXTRA_DIST = $(man_MANS) \


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to