home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b1af9d5
)
err_exit() now prints errno message, too.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 25 Aug 2013 02:04:14 +0000
(
04:04
+0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 25 Aug 2013 02:04:14 +0000
(
04:04
+0200)
src/rexit.c
patch
|
blob
|
history
diff --git
a/src/rexit.c
b/src/rexit.c
index ee71809a27cc671660aae218e2d4da8a3e31be7f..cb69ccd842c9275f41067e6704ae523bea9dfa60 100644
(file)
--- 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 "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 <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. */
/* 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);
msg = "Some error encountered. Aborted.";
}
printf("%s\n", msg);
+ errno = 0;
+ perror("errno states");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}