count);
printf("Storing %d keys.\n", count);
end_html();
- fclose(stdout);
- fclose(stderr);
+ if (stdout != NULL && fileno(stdout) != -1) {
+ fclose(stdout);
+ }
+ if (stderr != NULL && stderr != stdout &&
+ fileno(stderr) != -1) {
+ fclose(stderr);
+ }
catchsignals();
- initdb(false);
+ config.dbbackend->initdb(false);
count = cleankeys(keys);
logthing(LOGTHING_INFO, "%d keys cleaned.",
count);
- count = update_keys(&keys, true);
+ count = config.dbbackend->update_keys(&keys, true);
logthing(LOGTHING_NOTICE, "Got %d new keys.",
count);
keys = NULL;
}
- cleanupdb();
+ config.dbbackend->cleanupdb();
} else {
puts("No OpenPGP packets found in input.");
end_html();