static inline int si_nodeclose(sinode *n, sr *r) { int rcret = 0; int rc = sr_fileclose(&n->file); if (srunlikely(rc == -1)) { sr_malfunction(r->e, "db file '%s' close error: %s", n->file.file, strerror(errno)); rcret = -1; } sv_indexfree(&n->i0, r); sv_indexfree(&n->i1, r); return rcret; }
static int si_dropmark(si *i, sr *r) { /* create drop file */ char path[1024]; snprintf(path, sizeof(path), "%s/drop", i->conf->path); srfile drop; sr_fileinit(&drop, r->a); int rc = sr_filenew(&drop, path); if (srunlikely(rc == -1)) { sr_malfunction(r->e, "drop file '%s' create error: %s", path, strerror(errno)); return -1; } sr_fileclose(&drop); return 0; }