Skip to content
Snippets Groups Projects
Commit ba4a862b authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix compile errors

parent 7a1a3890
No related branches found
No related tags found
No related merge requests found
...@@ -45,13 +45,10 @@ ...@@ -45,13 +45,10 @@
void create_jwt(const char *json_key_file_path, const char *service_url, void create_jwt(const char *json_key_file_path, const char *service_url,
const char *scope) { const char *scope) {
grpc_auth_json_key key; grpc_auth_json_key key;
int ok = 0;
char *jwt; char *jwt;
gpr_slice json_key_data = gpr_load_file(json_key_file_path, 1, &ok); gpr_slice json_key_data;
if (!ok) { GPR_ASSERT(GRPC_LOG_IF_ERROR(
fprintf(stderr, "Could not read %s.\n", json_key_file_path); "load_file", gpr_load_file(json_key_file_path, 1, &json_key_data)));
exit(1);
}
key = grpc_auth_json_key_create_from_string( key = grpc_auth_json_key_create_from_string(
(const char *)GPR_SLICE_START_PTR(json_key_data)); (const char *)GPR_SLICE_START_PTR(json_key_data));
gpr_slice_unref(json_key_data); gpr_slice_unref(json_key_data);
......
...@@ -48,13 +48,10 @@ ...@@ -48,13 +48,10 @@
static grpc_call_credentials *create_refresh_token_creds( static grpc_call_credentials *create_refresh_token_creds(
const char *json_refresh_token_file_path) { const char *json_refresh_token_file_path) {
int success; gpr_slice refresh_token;
gpr_slice refresh_token = GPR_ASSERT(GRPC_LOG_IF_ERROR(
gpr_load_file(json_refresh_token_file_path, 1, &success); "load_file",
if (!success) { gpr_load_file(json_refresh_token_file_path, 1, &refresh_token)));
gpr_log(GPR_ERROR, "Could not read file %s.", json_refresh_token_file_path);
exit(1);
}
return grpc_google_refresh_token_credentials_create( return grpc_google_refresh_token_credentials_create(
(const char *)GPR_SLICE_START_PTR(refresh_token), NULL); (const char *)GPR_SLICE_START_PTR(refresh_token), NULL);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment