projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2e503e
)
exit if state file cannot be written
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 31 Oct 2011 10:22:32 +0000
(11:22 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 31 Oct 2011 10:22:32 +0000
(11:22 +0100)
index/zebraapi.c
patch
|
blob
|
history
diff --git
a/index/zebraapi.c
b/index/zebraapi.c
index
b696907
..
1c30eaa
100644
(file)
--- a/
index/zebraapi.c
+++ b/
index/zebraapi.c
@@
-1627,7
+1627,11
@@
static void zebra_set_state(ZebraHandle zh, int val, int seqno)
sprintf(state_fname, "state.%s.LCK", zh->reg_name);
fname = zebra_mk_fname(res_get(zh->res, "lockDir"), state_fname);
f = fopen(fname, "w");
-
+ if (!f)
+ {
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "open %s w", state_fname);
+ exit(1);
+ }
yaz_log(YLOG_DEBUG, "zebra_set_state: %c %d %ld", val, seqno, p);
fprintf(f, "%c %d %ld\n", val, seqno, p);
fclose(f);