summaryrefslogtreecommitdiffstats
path: root/src/local.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2014-11-26 16:32:36 +0100
committerPali Rohár <pali.rohar@gmail.com>2014-11-26 16:32:36 +0100
commit5633a067102ac35a623258bb71cb5d6396f50986 (patch)
treeedb37d0a5b47d64f2e30a3da736e804e2c7b6689 /src/local.c
parentd61815f40eef2583adc23a5c34d519847de26ca2 (diff)
download0xFFFF-5633a067102ac35a623258bb71cb5d6396f50986.tar.bz2
local: Enable N900 code only for ARM and enable Linux code only on Linux
Diffstat (limited to 'src/local.c')
-rw-r--r--src/local.c17
1 files changed, 16 insertions, 1 deletions
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) {