From 8dfc073b1487ab25ab483ab346cee1d9e584adb1 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 27 Jul 2012 15:30:51 -0700 Subject: [PATCH] Fix a TEMP_FAILURE_RETRY usage error in the linker. Similar to the fix in c20d0f3993ebb0d3dec958a306a68ebb48bfeadd. grep(1) says this was the only other instance in bionic. Change-Id: I1729038762ee1c7c4743a6bd11d5558afd6f5749 --- linker/linker.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/linker/linker.c b/linker/linker.c index b96e072b2..0a931308b 100644 --- a/linker/linker.c +++ b/linker/linker.c @@ -648,16 +648,15 @@ typedef struct { static unsigned long is_prelinked(int fd, const char *name) { - off_t sz; - prelink_info_t info; - - sz = lseek(fd, -sizeof(prelink_info_t), SEEK_END); + off_t sz = lseek(fd, -sizeof(prelink_info_t), SEEK_END); if (sz < 0) { DL_ERR("lseek() failed!"); return 0; } - if (TEMP_FAILURE_RETRY(read(fd, &info, sizeof(info)) != sizeof(info))) { + prelink_info_t info; + int rc = TEMP_FAILURE_RETRY(read(fd, &info, sizeof(info))); + if (rc != sizeof(info)) { WARN("Could not read prelink_info_t structure for `%s`\n", name); return 0; }