From cb7abfd6628e77481d06d449a691133df2e894bb Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Fri, 23 Jan 2015 18:31:03 -0800 Subject: [PATCH] fixup compile error in log_android.c compilation errors introduced in the following commit. commit 0cd69562fd8c005361e3f32ac0d3f9d43b713827 Author: ctiller Date: Fri Jan 9 14:22:10 2015 -0800 Allow logging mechanism to be overridden by applications. This necessitated the removal of gpr_vlog to keep a clean interface. Change on 2015/01/09 by ctiller ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=83634996 Errors are: grpc/src/core/support/log_android.c:75:20: error: 'file' undeclared (first use in this function) display_file = file; ^ grpc/src/core/support/log_android.c:75:20: note: each undeclared identifier is reported only once for each function it appears in grpc/src/core/support/log_android.c:79:13: error: 'prefix' undeclared (first use in this function) asprintf(&prefix, "%s:%d] %s", display_file, args->line, args->message); ^ grpc/src/core/support/log_android.c:85:8: error: 'suffix' undeclared (first use in this function) free(suffix); ^ --- src/core/support/log_android.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/support/log_android.c b/src/core/support/log_android.c index 11129e3e066..53c8153593a 100644 --- a/src/core/support/log_android.c +++ b/src/core/support/log_android.c @@ -72,17 +72,15 @@ void gpr_default_log(gpr_log_func_args *args) { final_slash = strrchr(args->file, '/'); if (final_slash == NULL) - display_file = file; + display_file = args->file; else display_file = final_slash + 1; - asprintf(&prefix, "%s:%d] %s", display_file, args->line, args->message); + asprintf(&output, "%s:%d] %s", display_file, args->line, args->message); __android_log_write(severity_to_log_priority(args->severity), "GRPC", output); /* allocated by asprintf => use free, not gpr_free */ - free(prefix); - free(suffix); free(output); }