Projects / DiscDB / Comments

Comments for DiscDB

12 Jul 2003 07:16 ngon

Patch for hang on add
This is a good little program. If any users out there encounter a hang when adding a CD, try using the patch below. I've tried e-mailing the author a couple times to no avail.

--- add.cc.orig 2001-01-22 00:45:13.000000000 -0500
+++ add.cc 2003-07-06 14:55:03.000000000 -0400
@@ -14,6 +14,7 @@
#include <sys/sysmacros.h>
#include <unistd.h>
#include <errno.h>
+#include <stdio.h>
#include <readline/readline.h>
#include <time.h>
#include "discdb.h"
@@ -296,8 +297,6 @@

do_scan("", basedir, 1);

- (void) closedir(discDIR);
-
query.reset();
query << "UPDATE discs";
query << " SET";
@@ -306,8 +305,15 @@
query << " dirs = " << dircount;
query << " WHERE discid = " << discID << ";";
query.execute(RESET_QUERY);
+ if (!query.success()) {
+ cerr << "Error updating database: "<< query.error() << endl;
+ }

cout << endl << filecount << " files totalling " << totalbytes << " bytes and " << dircount << " directories were indexed into the database." << endl;
- cout << endl << "Done. " << endl;
+ cout << "Done. " << endl;
+
+ // Moved this line here; previously before query.reset() and would cause hang.
+ (void) closedir(discDIR);
+
return 0;
}

Screenshot

Project Spotlight

ReciJournal

An open, cross-platform journaling program.

Screenshot

Project Spotlight

Veusz

A scientific plotting package.