Skip to content

Commit 4fd76c9

Browse files
committed
Remove fail function
We use dE macros for error reporting.
1 parent ee82c5b commit 4fd76c9

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/OVAL/probes/probe/worker.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@
4343
extern bool OSCAP_GSYM(varref_handling);
4444
extern void *OSCAP_GSYM(probe_arg);
4545

46-
47-
static int fail(int err, const char *who, int line)
48-
{
49-
fprintf(stderr, "FAIL: %d:%s: %d, %s\n", line, who, err, strerror(err));
50-
exit(err);
51-
}
52-
5346
// Dummy pthread routine
5447
static void *dummy_routine(void *dummy_param)
5548
{
@@ -60,8 +53,9 @@ static void preload_libraries_before_chroot()
6053
{
6154
// Force to load dynamic libraries used by pthread_cancel
6255
pthread_t t;
63-
if (pthread_create(&t, NULL, dummy_routine, NULL))
64-
fail(errno, "pthread_create(probe_preload)", __LINE__ - 1);
56+
if (pthread_create(&t, NULL, dummy_routine, NULL)) {
57+
dE("pthread_create failed: %s", strerror(errno));
58+
}
6559
pthread_cancel(t);
6660
pthread_join(t, NULL);
6761
}
@@ -998,11 +992,11 @@ SEXP_t *probe_worker(probe_t *probe, SEAP_msg_t *msg_in, int *ret)
998992
probe->real_root_fd = open("/", O_RDONLY);
999993
probe->real_cwd_fd = open(".", O_RDONLY);
1000994
if (chdir(rootdir) != 0) {
1001-
fail(errno, "chdir", __LINE__ -1);
995+
dE("chdir failed: %s", strerror(errno));
1002996
}
1003997

1004998
if (chroot(rootdir) != 0) {
1005-
fail(errno, "chroot", __LINE__ - 1);
999+
dE("chroot failed: %s", strerror(errno));
10061000
}
10071001
/* NOTE: We're running in a different root directory.
10081002
* Unless /proc, /sys are somehow emulated for the new

0 commit comments

Comments
 (0)