43
43
extern bool OSCAP_GSYM (varref_handling );
44
44
extern void * OSCAP_GSYM (probe_arg );
45
45
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
-
53
46
// Dummy pthread routine
54
47
static void * dummy_routine (void * dummy_param )
55
48
{
@@ -60,8 +53,9 @@ static void preload_libraries_before_chroot()
60
53
{
61
54
// Force to load dynamic libraries used by pthread_cancel
62
55
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
+ }
65
59
pthread_cancel (t );
66
60
pthread_join (t , NULL );
67
61
}
@@ -998,11 +992,11 @@ SEXP_t *probe_worker(probe_t *probe, SEAP_msg_t *msg_in, int *ret)
998
992
probe -> real_root_fd = open ("/" , O_RDONLY );
999
993
probe -> real_cwd_fd = open ("." , O_RDONLY );
1000
994
if (chdir (rootdir ) != 0 ) {
1001
- fail ( errno , "chdir" , __LINE__ - 1 );
995
+ dE ( "chdir failed: %s " , strerror ( errno ) );
1002
996
}
1003
997
1004
998
if (chroot (rootdir ) != 0 ) {
1005
- fail ( errno , "chroot" , __LINE__ - 1 );
999
+ dE ( "chroot failed: %s " , strerror ( errno ) );
1006
1000
}
1007
1001
/* NOTE: We're running in a different root directory.
1008
1002
* Unless /proc, /sys are somehow emulated for the new
0 commit comments