mirror of
https://github.com/owntracks/recorder.git
synced 2026-05-05 02:36:45 +00:00
support named databases
This commit is contained in:
5
Makefile
5
Makefile
@@ -48,7 +48,7 @@ ghash2lmdb: ghash2lmdb.o $(OTR_OBJS)
|
||||
$(CC) $(CFLAGS) -o ghash2lmdb ghash2lmdb.o $(OTR_OBJS) $(LIBS)
|
||||
|
||||
|
||||
ot-recorder.o: ot-recorder.c storage.h util.h Makefile geo.h udata.h config.h json.h http.h
|
||||
ot-recorder.o: ot-recorder.c storage.h util.h Makefile geo.h udata.h config.h json.h http.h gcache.h
|
||||
geo.o: geo.h geo.c udata.h Makefile config.mk config.h
|
||||
geohash.o: geohash.h geohash.c udata.h Makefile config.mk
|
||||
base64.o: base64.h base64.c
|
||||
@@ -60,7 +60,8 @@ util.o: util.c util.h Makefile config.mk
|
||||
ghashfind.o: ghashfind.c util.h
|
||||
mongoose.o: mongoose.c mongoose.h
|
||||
ocat.o: ocat.c storage.h util.h
|
||||
storage.o: storage.c storage.h config.h util.h
|
||||
storage.o: storage.c storage.h config.h util.h gcache.h
|
||||
ghash2lmdb.o: ghash2lmdb.c gcache.h
|
||||
|
||||
|
||||
clean:
|
||||
|
||||
2
gcache.c
2
gcache.c
@@ -171,7 +171,7 @@ long gcache_get(struct gcache *gc, char *k, char *buf, long buflen)
|
||||
MDB_val key, data;
|
||||
MDB_txn *txn;
|
||||
int rc;
|
||||
long len;
|
||||
long len = -1;
|
||||
|
||||
if (gc == NULL)
|
||||
return (-1);
|
||||
|
||||
@@ -35,7 +35,7 @@ int main(int argc,char * argv[])
|
||||
return (1);
|
||||
}
|
||||
|
||||
gc = gcache_open(argv[1], 0);
|
||||
gc = gcache_open(argv[1], NULL, 0);
|
||||
if (gc == NULL) {
|
||||
fprintf(stderr, "%s Cannot open ghash store at %s\n", argv[0], argv[1]);
|
||||
return (1);
|
||||
|
||||
@@ -840,7 +840,7 @@ int main(int argc, char **argv)
|
||||
pa = strdup(db_filename);
|
||||
mkpath(pa);
|
||||
free(pa);
|
||||
udata.gc = gcache_open(db_filename, FALSE);
|
||||
udata.gc = gcache_open(db_filename, NULL, FALSE);
|
||||
if (udata.gc == NULL) {
|
||||
olog(LOG_ERR, "Can't initialize gcache in %s", db_filename);
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user