From 5633a067102ac35a623258bb71cb5d6396f50986 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Wed, 26 Nov 2014 16:32:36 +0100 Subject: local: Enable N900 code only for ARM and enable Linux code only on Linux --- src/local.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/local.c') diff --git a/src/local.c b/src/local.c index f2cdba4..5dc14ee 100644 --- a/src/local.c +++ b/src/local.c @@ -55,6 +55,8 @@ static int root_device = -1; #define local_cal_read(cal, str, ptr, len) ( cal_read_block(cal, str, &ptr, &len, 0) == 0 && ptr ) #define local_cal_readcopy(cal, str, dest) do { void * ptr; unsigned long int len; if ( local_cal_read(cal, str, ptr, len) ) local_cal_copy(dest, ptr, len); } while ( 0 ) +#if defined(__linux__) && defined(__arm__) + static void local_cal_parse(void) { struct cal * cal = NULL; @@ -109,16 +111,22 @@ static void local_cal_parse(void) { } +#endif + int local_init(void) { +#if defined(__linux__) && defined(__arm__) char buf[1024]; char * ptr; char * ptr2; FILE * file; +#endif if ( failed ) return -1; +#if defined(__linux__) && defined(__arm__) + file = fopen("/proc/cpuinfo", "r"); if ( ! file ) { failed = 1; @@ -174,9 +182,12 @@ int local_init(void) { } + fclose(file); + +#endif + failed = 1; printf("Not a local device\n"); - fclose(file); return -1; } @@ -284,6 +295,8 @@ static struct nanddump_device nanddump[] = { static void local_find_internal_mydocs(int * maj, int * min) { +#ifdef __linux__ + int fd; DIR * dir; DIR * dir2; @@ -361,6 +374,8 @@ static void local_find_internal_mydocs(int * maj, int * min) { closedir(dir); +#endif + } int local_dump_image(enum image_type image, const char * file) { -- cgit v1.2.3