From 288726981a158c894c223fa762b71baadd89e467 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Wed, 21 Nov 2012 14:14:21 +0100 Subject: local: Do not call local_init more times --- src/local.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/local.c') diff --git a/src/local.c b/src/local.c index a56a9a3..04503eb 100644 --- a/src/local.c +++ b/src/local.c @@ -30,6 +30,7 @@ #include "image.h" static enum device device = DEVICE_UNKNOWN; +static int failed; int local_init(void) { @@ -38,9 +39,14 @@ int local_init(void) { char * ptr2; FILE * file; + if ( failed ) + return -1; + file = fopen("/proc/cpuinfo", "r"); - if (!file) + if ( ! file ) { + failed = 1; return -1; + } while ( fgets(buf, sizeof(buf), file) ) { @@ -100,6 +106,7 @@ int local_init(void) { } + failed = 1; printf("Not a local device\n"); fclose(file); return -1; -- cgit v1.2.3