sock.sun_family = AF_UNIX;
snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
sock.sun_family = AF_UNIX;
snprintf(sock.sun_path, sizeof(sock.sun_path) - 1, "%s/%s",
- keyd_do_command(KEYD_CMD_VERSION, &reply, sizeof(reply));
+ if (keyd_do_command(KEYD_CMD_VERSION, &reply, sizeof(reply)) == -1) {
+ printf("Got failure asking for keyd version.\n");
+ return;
+ }
- keyd_do_command(KEYD_CMD_STATS, &stats, sizeof(stats));
+ if (keyd_do_command(KEYD_CMD_STATS, &stats, sizeof(stats)) == -1) {
+ printf("Got failure asking for keyd statistics.\n");
+ return;
+ }
+
printf("keyd running since %s", ctime(&stats.started));
printf("%d client connections received\n", stats.connects);
printf("keyd running since %s", ctime(&stats.started));
printf("%d client connections received\n", stats.connects);
stats.command_stats[KEYD_CMD_GET_ID]);
printf(" Get key by FP: %d\n",
stats.command_stats[KEYD_CMD_GET_FP]);
stats.command_stats[KEYD_CMD_GET_ID]);
printf(" Get key by FP: %d\n",
stats.command_stats[KEYD_CMD_GET_FP]);
printf(" Store key: %d\n",
stats.command_stats[KEYD_CMD_STORE]);
printf(" Delete key: %d\n",
stats.command_stats[KEYD_CMD_DELETE]);
printf(" Store key: %d\n",
stats.command_stats[KEYD_CMD_STORE]);
printf(" Delete key: %d\n",
stats.command_stats[KEYD_CMD_DELETE]);
printf(" Search key: %d\n",
stats.command_stats[KEYD_CMD_GET_TEXT]);
printf(" Get full keyid: %d\n",
printf(" Search key: %d\n",
stats.command_stats[KEYD_CMD_GET_TEXT]);
printf(" Get full keyid: %d\n",