aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_db.c
diff options
context:
space:
mode:
authorPeter Seebach <seebs@eee12.(none)>2010-04-30 12:30:01 -0500
committerPeter Seebach <seebs@eee12.(none)>2010-04-30 17:54:12 -0500
commit0bc0b5a7f6eecb6bc129b1ab3b35d69f93c9e7a4 (patch)
tree2b4e0ef6168b262f8e59a50197f3edc3cebc2409 /pseudo_db.c
parentf97830a23402ac218a477828bf481bcff139507d (diff)
downloadpseudo-0bc0b5a7f6eecb6bc129b1ab3b35d69f93c9e7a4.tar.gz
pseudo-0bc0b5a7f6eecb6bc129b1ab3b35d69f93c9e7a4.tar.bz2
pseudo-0bc0b5a7f6eecb6bc129b1ab3b35d69f93c9e7a4.zip
Miscellaneous cleanup.
Address a couple of compiler warnings, add a couple of signals to the list of caught signals, etcetera.
Diffstat (limited to 'pseudo_db.c')
-rw-r--r--pseudo_db.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/pseudo_db.c b/pseudo_db.c
index 3839581..9d310c9 100644
--- a/pseudo_db.c
+++ b/pseudo_db.c
@@ -1402,7 +1402,7 @@ pdb_update_file_path(pseudo_msg_t *msg) {
int
pdb_unlink_file(pseudo_msg_t *msg) {
static sqlite3_stmt *delete_exact, *delete_sub;
- int rc;
+ int rc, exact, sub;
char *sql_delete_exact = "DELETE FROM files WHERE path = ?;";
char *sql_delete_sub = "DELETE FROM files WHERE "
"(path > (? || '/') AND path < (? || '0'));";
@@ -1440,14 +1440,13 @@ pdb_unlink_file(pseudo_msg_t *msg) {
if (rc != SQLITE_DONE) {
dberr(file_db, "delete exact by path may have failed");
}
- rc = sqlite3_changes(file_db);
- pseudo_debug(2, "(exact %d, ", rc);
+ exact = sqlite3_changes(file_db);
rc = sqlite3_step(delete_sub);
if (rc != SQLITE_DONE) {
dberr(file_db, "delete sub by path may have failed");
}
- rc = sqlite3_changes(file_db);
- pseudo_debug(2, "sub %d) ", rc);
+ sub = sqlite3_changes(file_db);
+ pseudo_debug(3, "(exact %d, sub %d) ", exact, sub);
sqlite3_reset(delete_exact);
sqlite3_reset(delete_sub);
sqlite3_clear_bindings(delete_exact);
@@ -1555,7 +1554,11 @@ pdb_update_inode(pseudo_msg_t *msg) {
sqlite3_bind_int(update, 2, msg->ino);
rc = sqlite3_bind_text(update, 3, msg->path, -1, SQLITE_STATIC);
if (rc) {
- dberr(file_db, "error binding %s to select", msg->pathlen ? msg->path : "<nil>");
+ /* msg->path can never be null, and if msg didn't
+ * have a non-zero pathlen, we'd already have exited
+ * above
+ */
+ dberr(file_db, "error binding %s to select", msg->path);
}
rc = sqlite3_step(update);