Index: /soft/giet_vm/giet_kernel/ctx_handler.c
===================================================================
--- /soft/giet_vm/giet_kernel/ctx_handler.c	(revision 704)
+++ /soft/giet_vm/giet_kernel/ctx_handler.c	(revision 705)
@@ -127,6 +127,6 @@
 
     // load Elf-Header into buffer from .elf file
-    if ( _fat_lseek( fd, 0, SEEK_SET ) ) return 1; 
-    if ( _fat_read( fd, buf, 4096 ) ) return 1;
+    if ( _fat_lseek( fd, 0, SEEK_SET ) < 0 ) return 1;
+    if ( _fat_read( fd, buf, 4096 ) < 0 ) return 1;
 
 #if GIET_DEBUG_SWITCH
@@ -141,7 +141,7 @@
     unsigned int nsegments      = elf_header_ptr->e_phnum;
 
-    // load Program-Header-Table from .elf file 
-    if ( _fat_lseek( fd, offset, SEEK_SET ) ) return 1;
-    if ( _fat_read( fd, buf, 4096 ) ) return 1;
+    // load Program-Header-Table from .elf file
+    if ( _fat_lseek( fd, offset, SEEK_SET ) < 0 ) return 1;
+    if ( _fat_read( fd, buf, 4096 ) < 0 ) return 1;
 
 #if GIET_DEBUG_SWITCH
@@ -167,6 +167,6 @@
 
             // load the segment
-            if ( _fat_lseek( fd, seg_offset, SEEK_SET ) ) return 1;
-            if ( _fat_read( fd, (void*)seg_vaddr, seg_size ) ) return 1;
+            if ( _fat_lseek( fd, seg_offset, SEEK_SET ) < 0 ) return 1;
+            if ( _fat_read( fd, (void*)seg_vaddr, seg_size ) < 0 ) return 1;
 
 #if GIET_DEBUG_SWITCH
