From 9e12416aa36cc77957627900c2c1fc0055936504 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sun, 25 Aug 2013 04:04:14 +0200
Subject: [PATCH] err_exit() now prints errno message, too.

---
 src/rexit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/rexit.c b/src/rexit.c
index ee71809..cb69ccd 100644
--- a/src/rexit.c
+++ b/src/rexit.c
@@ -2,13 +2,14 @@
 
 #include "rexit.h"
 #include <stdlib.h> /* for exit(), free(), defines EXIT_SUCESS, EXIT_FAILURE */
-#include <stdio.h> /* for printf() */
+#include <stdio.h> /* for printf(), perror() */
 #include <stdint.h> /* for uint8_t */
 #include <ncurses.h> /* for endwin() */
 #include "main.h" /* for World struct */
 #include "map.h" /* for Map struct */
 #include "keybindings.h" /* for KeysWinData, KeyBinding structs */
 
+#include "errno.h"
 
 
 /* The clean-up routine and the flag resource by which it decides what to do. */
@@ -72,5 +73,7 @@ extern void exit_err(uint8_t err, struct World * world, char * msg)
         msg = "Some error encountered. Aborted.";
     }
     printf("%s\n", msg);
+    errno = 0;
+    perror("errno states");
     exit(EXIT_FAILURE);
 }
-- 
2.30.2