chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
debian/control: db4.8 is obsolete in wheezy.
[disorder]
/
server
/
dump.c
diff --git
a/server/dump.c
b/server/dump.c
index 74f1c466360a62fccfffc0310b4eb04e053ac313..475fc8188bd837f9eee633d40c732db936cc13dd 100644
(file)
--- a/
server/dump.c
+++ b/
server/dump.c
@@
-1,6
+1,6
@@
/*
* This file is part of DisOrder.
/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005, 2007
, 2008
Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2007
-2011
Richard Kettlewell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-408,8
+408,6
@@
int main(int argc, char **argv) {
}
if(config_read(0, NULL))
disorder_fatal(0, "cannot read configuration");
}
if(config_read(0, NULL))
disorder_fatal(0, "cannot read configuration");
- trackdb_init(recover|TRACKDB_MAY_CREATE);
- trackdb_open(TRACKDB_NO_UPGRADE);
if(dump) {
/* We write to a temporary file and rename into place. We make
* sure the permissions are tight from the start. */
if(dump) {
/* We write to a temporary file and rename into place. We make
* sure the permissions are tight from the start. */
@@
-418,6
+416,8
@@
int main(int argc, char **argv) {
disorder_fatal(errno, "error opening %s", tmp);
if(!(fp = fdopen(fd, "w")))
disorder_fatal(errno, "fdopen on %s", tmp);
disorder_fatal(errno, "error opening %s", tmp);
if(!(fp = fdopen(fd, "w")))
disorder_fatal(errno, "fdopen on %s", tmp);
+ trackdb_init(recover|TRACKDB_MAY_CREATE);
+ trackdb_open(TRACKDB_NO_UPGRADE);
do_dump(fp, tmp);
if(fclose(fp) < 0) disorder_fatal(errno, "error closing %s", tmp);
if(rename(tmp, path) < 0)
do_dump(fp, tmp);
if(fclose(fp) < 0) disorder_fatal(errno, "error closing %s", tmp);
if(rename(tmp, path) < 0)
@@
-432,6
+432,8
@@
int main(int argc, char **argv) {
* if new ones are created */
if(getuid() == 0)
disorder_info("you might need to chown database files");
* if new ones are created */
if(getuid() == 0)
disorder_info("you might need to chown database files");
+ trackdb_init(recover|TRACKDB_MAY_CREATE);
+ trackdb_open(TRACKDB_NO_UPGRADE);
do_undump(fp, path, remove_pathless);
xfclose(fp);
} else if(recompute) {
do_undump(fp, path, remove_pathless);
xfclose(fp);
} else if(recompute) {