From d0b2f91bede3bd5e3d24dd6803e56eee959c1797 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 20 Oct 2016 00:10:27 -0300 Subject: Linux-libre 4.8.2-gnu --- tools/perf/jvmti/jvmti_agent.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tools/perf/jvmti/jvmti_agent.c') diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c index 3573f315f..55daefff0 100644 --- a/tools/perf/jvmti/jvmti_agent.c +++ b/tools/perf/jvmti/jvmti_agent.c @@ -59,7 +59,6 @@ static int get_e_machine(struct jitheader *hdr) ssize_t sret; char id[16]; int fd, ret = -1; - int m = -1; struct { uint16_t e_type; uint16_t e_machine; @@ -81,11 +80,7 @@ static int get_e_machine(struct jitheader *hdr) if (sret != sizeof(info)) goto error; - m = info.e_machine; - if (m < 0) - m = 0; /* ELF EM_NONE */ - - hdr->elf_mach = m; + hdr->elf_mach = info.e_machine; ret = 0; error: close(fd); @@ -491,10 +486,11 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file, if (sret != 1) goto error; } - if (padding_count) + if (padding_count) { sret = fwrite_unlocked(pad_bytes, padding_count, 1, fp); if (sret != 1) goto error; + } funlockfile(fp); return 0; -- cgit v1.2.3-54-g00ecf