tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/modules/security/wrappers: drop dead code
edef
2 years ago
89e45f23
38b89f26
-8
1 changed file
expand all
collapse all
unified
split
nixos
modules
security
wrappers
wrapper.c
-8
nixos/modules/security/wrappers/wrapper.c
···
26
26
27
27
// aborts when false, printing the failed expression
28
28
#define ASSERT(expr) ((expr) ? (void) 0 : assert_failure(#expr))
29
29
-
// aborts when returns non-zero, printing the failed expression and errno
30
30
-
#define MUSTSUCCEED(expr) ((expr) ? print_errno_and_die(#expr) : (void) 0)
31
29
32
30
extern char **environ;
33
31
···
44
42
45
43
static noreturn void assert_failure(const char *assertion) {
46
44
fprintf(stderr, "Assertion `%s` in NixOS's wrapper.c failed.\n", assertion);
47
47
-
fflush(stderr);
48
48
-
abort();
49
49
-
}
50
50
-
51
51
-
static noreturn void print_errno_and_die(const char *assertion) {
52
52
-
fprintf(stderr, "Call `%s` in NixOS's wrapper.c failed: %s\n", assertion, strerror(errno));
53
45
fflush(stderr);
54
46
abort();
55
47
}