From: Christian Heller Date: Sun, 25 Aug 2013 02:04:14 +0000 (+0200) Subject: err_exit() now prints errno message, too. X-Git-Tag: tce~1058 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Byoutube_prefix%7D%7D%7B%7Bvideo_data.id_%7D%7D?a=commitdiff_plain;h=9e12416aa36cc77957627900c2c1fc0055936504;p=plomrogue err_exit() now prints errno message, too. --- 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 /* for exit(), free(), defines EXIT_SUCESS, EXIT_FAILURE */ -#include /* for printf() */ +#include /* for printf(), perror() */ #include /* for uint8_t */ #include /* 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); }