dualinit

A meta-init system for linux
Log | Files | Refs | LICENSE

commit a1e51ee21beafd5c2490b0491b570d34a6052fa4
parent c96624b280b1e88fecaa9997c14fbf7abdf1e61f
Author: Friedel Schoen <[email protected]>
Date:   Wed, 28 Dec 2022 15:03:23 +0100

add VERBOSE(...)

Diffstat:
Mincl/common.h | 26+++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/incl/common.h b/incl/common.h @@ -1,10 +1,18 @@ #pragma once +#define VERBOSE(format...) \ + { \ + if (color) { \ + printf("\e[33mdebug:\e[0m " format); \ + } else \ + printf("debug: " format); \ + } + #define INFO(format...) \ { \ - if (verbose && color) { \ + if (color) { \ printf("\e[36m::\e[0m " format); \ - } else if (verbose) \ + } else \ printf(":: " format); \ } @@ -16,13 +24,13 @@ printf("error: " format); \ } -#ifdef IS_CLI -# define DIE exit(1) -#else -# define DIE \ - while (1) \ - ; -#endif +#define DIE \ + if (getpid() == 1) { \ + while (1) \ + ; \ + } else { \ + exit(1); \ + } #define PANIC(format...) \ { \