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

Modified Files:
        merovingian.mx monetdb.mx 
Log Message:
Use a known location for the lock file.


U merovingian.mx
Index: merovingian.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian.mx,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- merovingian.mx      10 Oct 2008 08:54:10 -0000      1.58
+++ merovingian.mx      12 Oct 2008 10:31:29 -0000      1.59
@@ -1761,7 +1761,7 @@
        err e;
        int argp;
        str dbfarm, msglog, errlog, pidfilename;
-       str p, prefix;
+       str p, prefix, c;
        FILE *cnf = NULL, *pidfile = NULL;
        char buf[1024];
        char lockfile[512];
@@ -1935,7 +1935,13 @@
                return(1);
        }
 
-       snprintf(lockfile, 512, "%s/.merovingian_lock", dbfarm);
+       /* the lock file is placed in the same directory as the pid */
+       strcpy(lockfile, pidfilename);
+       c= strrchr(lockfile,'/');
+       if (c)
+               strcpy(c+1,".merovingian_lock");
+       } else
+               strcat(lockfile, ".merovingian_lock");
        /* lock such that we are alone on this world */
        if ((ret = MT_lockf(lockfile, F_TLOCK, 4, 1)) == -1) {
                /* locking failed */

U monetdb.mx
Index: monetdb.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/monetdb.mx,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- monetdb.mx  10 Oct 2008 08:54:15 -0000      1.27
+++ monetdb.mx  12 Oct 2008 10:31:29 -0000      1.28
@@ -24,7 +24,7 @@
 The monetdb utility is designed to be the interface for the DBA to the
 dbfarm.  Creating or deleting databases next to retrieving status
 information about them are the primary goals of this tool.
-
[EMAIL PROTECTED]
 @h
 #define TOOLKIT_VERSION   "0.4"
 
@@ -282,11 +282,13 @@
                }
                /* demo | state | uptime | health */
                secondsToString(avg, uplog.avguptime, 0);
-               printf("%-14s  %s %12s  %3d%%, %3s  %s\n",
-                               dbname,
-                               state, uptime,
-                               100 - (uplog.crashcntr * 100 / uplog.startcntr),
-                               avg, crash);
+                       printf("%-14s  %s %12s",
+                                       dbname, state, uptime);
+               if (uplog.startcntr)
+                       printf("  %3d%%, %3s  %s",
+                                       100 - (uplog.crashcntr * 100 / 
uplog.startcntr),
+                                       avg, crash);
+               printf("\n");
        } else if (mode == 2) {
                /* long mode */
                char *state;
@@ -1076,9 +1078,10 @@
                                printf("you are about to remove database 
'%s'\n", dbname);
                                printf("ALL data in this database will get 
lost, "
                                                "are you sure? [y/N] ");
-                               if (scanf("%c", &answ) >= 1 && (answ == 'y' || 
answ == 'Y')) {
-                                       /* do it! */
-                               } else {
+                               answ = getchar();
+                               while (answ!= '\n' && getchar()!= '\n') 
+                                       ;
+                               if (answ != 'y' && answ != 'Y') {
                                        printf("battle control terminated\n");
                                        exit(0);
                                }
@@ -1361,4 +1364,5 @@
        return(0);
 }
 
[EMAIL PROTECTED]
 /* vim:set ts=4 sw=4 noexpandtab: */


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to