fixup compile error in log_android.c
compilation errors introduced in the following commit.
commit 0cd69562fd8c005361e3f32ac0d3f9d43b713827
Author: ctiller <ctiller@google.com>
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 <ctiller@google.com>
-------------
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);
^
diff --git a/src/core/support/log_android.c b/src/core/support/log_android.c
index 11129e3..53c8153 100644
--- a/src/core/support/log_android.c
+++ b/src/core/support/log_android.c
@@ -72,17 +72,15 @@
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);
}