diff options
Diffstat (limited to 'src/local.c')
-rw-r--r-- | src/local.c | 9 |
1 files changed, 8 insertions, 1 deletions
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; |