flashrom: exit(2) on /dev/mem open() failure and exit(3) on mmap() failure.
authorPeter Stuge <peter@stuge.se>
Mon, 26 Jan 2009 02:04:19 +0000 (02:04 +0000)
committerPeter Stuge <peter@stuge.se>
Mon, 26 Jan 2009 02:04:19 +0000 (02:04 +0000)
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Ward Vandewege <ward@gnu.org>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3907 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/flashrom/physmap.c

index d9fd56003a03856b1ef2f4d5403246d960a5017f..0fb6c5ca6a987550d33cb8eb04f96cfcb43c0804 100644 (file)
@@ -57,7 +57,7 @@ void *sys_physmap(unsigned long phys_addr, size_t len)
                /* Open the memory device UNCACHED. Important for MMIO. */
                if (-1 == (fd_mem = open(MEM_DEV, O_RDWR|O_SYNC))) {
                        perror("Critical error: open(" MEM_DEV ")");
-                       exit(1);
+                       exit(2);
                }
        }
 
@@ -87,7 +87,7 @@ void *physmap(const char *descr, unsigned long phys_addr, size_t len)
                        fprintf(stderr, "You can override CONFIG_X86_PAT at boot with the nopat kernel parameter but\n");
                        fprintf(stderr, "disabling the other option unfortunately requires a kernel recompile. Sorry!\n");
                }
-               exit(1);
+               exit(3);
        }
 
        return virt_addr;