This shows you the differences between two versions of the page.
so:laboratoare:resurse:die [2018/02/26 08:57] mbarbulescu [Concluzie] |
so:laboratoare:resurse:die [2018/03/02 23:36] (current) mihai.popescu1212 [Macro-ul DIE] |
||
---|---|---|---|
Line 14: | Line 14: | ||
<code c> | <code c> | ||
+ | #include <errno.h> | ||
#define DIE(assertion, call_description) \ | #define DIE(assertion, call_description) \ | ||
do { \ | do { \ | ||
Line 20: | Line 21: | ||
__FILE__, __LINE__); \ | __FILE__, __LINE__); \ | ||
perror(call_description); \ | perror(call_description); \ | ||
- | exit(EXIT_FAILURE); \ | + | exit(errno); \ |
} \ | } \ | ||
} while (0) | } while (0) |