diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-04-08 06:53:37 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-04-08 06:53:37 +0200 |
commit | bed3a2c681fd5827c22f02ad026dcff5fc7470fd (patch) | |
tree | 4dcf53791bb23154844a9bec84dc98d375c3bfb6 | |
parent | 5247787fcf35be5c9b79b62cfacadd361ccebf75 (diff) |
test
-rw-r--r-- | src/kms/kms_client.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/kms/kms_client.c b/src/kms/kms_client.c index c7b9b16..948a7b6 100644 --- a/src/kms/kms_client.c +++ b/src/kms/kms_client.c @@ -93,6 +93,8 @@ int gsr_kms_client_init(gsr_kms_client *self, const char *card_path, const char } } + fprintf(stderr, "gsr info: gsr server path: %s, exists: %s\n", server_filepath, access(server_filepath, F_OK) == 0 ? "yes" : "no"); + self->card_path = strdup(card_path); if(!self->card_path) { fprintf(stderr, "gsr error: gsr_kms_client_init: failed to duplicate card_path\n"); @@ -163,11 +165,8 @@ int gsr_kms_client_init(gsr_kms_client *self, const char *card_path, const char } else { int status; int wait_result = waitpid(self->kms_server_pid, &status, WNOHANG); - if(wait_result > 0) { - fprintf(stderr, "gsr error: gsr_kms_client_init: waitpid failed on kms server, error: %s\n", strerror(errno)); - goto err; - } else if(wait_result > 0) { - fprintf(stderr, "gsr error: gsr_kms_client_init: kms server died\n"); + if(wait_result != 0) { + fprintf(stderr, "gsr error: gsr_kms_client_init: kms server died or never started, error: %s\n", strerror(errno)); goto err; } } |