]> code.citadel.org Git - citadel.git/commitdiff
* database_sleepycat.c: added a couple of diagnostic messages to help
authorArt Cancro <ajc@citadel.org>
Thu, 22 May 2003 13:34:31 +0000 (13:34 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 22 May 2003 13:34:31 +0000 (13:34 +0000)
  troubleshoot problems with db-4.1.25 on Red Hat Linux 9
* room_ops.c: call mkdir() instead of system() to create a directory

citadel/ChangeLog
citadel/database_sleepycat.c
citadel/room_ops.c

index 8e3d9f08206bc06d63f3d418d88430af0f82f18f..ff30e5ebea89f0f157c10c8fd43bb7b4057a23d3 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 606.2  2003/05/22 13:34:30  ajc
+ * database_sleepycat.c: added a couple of diagnostic messages to help
+   troubleshoot problems with db-4.1.25 on Red Hat Linux 9
+ * room_ops.c: call mkdir() instead of system() to create a directory
+
  Revision 606.1  2003/05/20 01:28:50  error
  * citadel.c: don't truncate roomname when user is idle, in long who list;
    display idle time in short who list
@@ -4714,3 +4719,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index b24379ce05ee7d44191c6ac03d4e9731b72518c4..6a2f0be62f28127353b00ce9eea8b1b60fbfa214 100644 (file)
@@ -277,18 +277,23 @@ void open_databases(void)
        int i;
        char dbfilename[SIZ];
        u_int32_t flags = 0;
+       char dbdirname[PATH_MAX];
+
+       getcwd(dbdirname, sizeof dbdirname);
+       strcat(dbdirname, "/data");
 
        lprintf(9, "cdb_*: open_databases() starting\n");
-       lprintf(5, "%s\n", db_version(NULL, NULL, NULL));
+       lprintf(9, "Compiled db: %s\n", DB_VERSION_STRING);
+       lprintf(5, "  Linked db: %s\n", db_version(NULL, NULL, NULL));
 #ifdef HAVE_ZLIB
-       lprintf(5, "zlib compression version %s\n", zlibVersion());
+       lprintf(5, "Linked zlib: %s\n", zlibVersion());
 #endif
 
         /*
          * Silently try to create the database subdirectory.  If it's
          * already there, no problem.
          */
-        system("exec mkdir data 2>/dev/null");
+       mkdir(dbdirname, 0700);
 
        lprintf(9, "cdb_*: Setting up DB environment\n");
        db_env_set_func_yield(sched_yield);
@@ -318,7 +323,8 @@ void open_databases(void)
 
         flags = DB_CREATE|DB_RECOVER|DB_INIT_MPOOL|DB_PRIVATE|DB_INIT_TXN|
                DB_INIT_LOCK|DB_THREAD;
-        ret = dbenv->open(dbenv, "./data", flags, 0);
+       lprintf(9, "dbenv->open(dbenv, %s, %d, 0)\n", dbdirname, flags);
+        ret = dbenv->open(dbenv, dbdirname, flags, 0);
        if (ret) {
                lprintf(1, "cdb_*: dbenv->open: %s\n", db_strerror(ret));
                 dbenv->close(dbenv, 0);
index 28c6f497152934760f916ea1d08a62301e7f4121..3d701b95e6c812d9bad61de1645171947cda0cdd 100644 (file)
@@ -1326,10 +1326,9 @@ void cmd_setr(char *args)
 
        /* Create a room directory if necessary */
        if (CC->quickroom.QRflags & QR_DIRECTORY) {
-               snprintf(buf, sizeof buf,
-                   "mkdir ./files/%s </dev/null >/dev/null 2>/dev/null",
+               snprintf(buf, sizeof buf, "./files/%s",
                        CC->quickroom.QRdirname);
-               system(buf);
+               mkdir(buf, 0755);
        }
        snprintf(buf, sizeof buf, "%s> edited by %s\n", CC->quickroom.QRname, CC->curr_user);
        aide_message(buf);