BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
fprintf(stderr,
"Wrong version of backup file, expected %u, got %lu\n",
DB_VERSION, db_hdr.version);
+ close(fd);
return EINVAL;
}
ret = ctdb_rec_buffer_read(fd, mem_ctx, &recbuf);
if (ret != 0) {
fprintf(stderr, "Failed to read records\n");
+ close(fd);
return ret;
}
&state);
if (ret != 0) {
fprintf(stderr, "Failed to dump records\n");
+ close(fd);
return ret;
}
}
+ close(fd);
printf("Dumped %u record(s)\n", state.sub_state.count);
return 0;
}