@@ -45,19 +45,8 @@ int safe_chroot(const char *file, const int lineno, const char *path);
45
45
#define SAFE_DIRNAME (path ) \
46
46
safe_dirname(__FILE__, __LINE__, NULL, (path))
47
47
48
- static inline int safe_dup (const char * file , const int lineno ,
49
- int oldfd )
50
- {
51
- int rval ;
52
-
53
- rval = dup (oldfd );
54
- if (rval == -1 ) {
55
- tst_brk_ (file , lineno , TBROK | TERRNO ,
56
- "dup(%i) failed" , oldfd );
57
- }
48
+ int safe_dup (const char * file , const int lineno , int oldfd );
58
49
59
- return rval ;
60
- }
61
50
#define SAFE_DUP (oldfd ) \
62
51
safe_dup(__FILE__, __LINE__, (oldfd))
63
52
@@ -439,21 +428,8 @@ static inline int safe_setrlimit(const char *file, const int lineno,
439
428
safe_setrlimit(__FILE__, __LINE__, (resource), (rlim))
440
429
441
430
typedef void (* sighandler_t )(int );
442
- static inline sighandler_t safe_signal (const char * file , const int lineno ,
443
- int signum , sighandler_t handler )
444
- {
445
- sighandler_t rval ;
446
-
447
- rval = signal (signum , handler );
448
-
449
- if (rval == SIG_ERR ) {
450
- tst_brk_ (file , lineno , TBROK | TERRNO ,
451
- "signal(%d,%p) failed" ,
452
- signum , handler );
453
- }
454
-
455
- return rval ;
456
- }
431
+ sighandler_t safe_signal (const char * file , const int lineno ,
432
+ int signum , sighandler_t handler );
457
433
458
434
#define SAFE_SIGNAL (signum , handler ) \
459
435
safe_signal(__FILE__, __LINE__, (signum), (handler))
@@ -601,19 +577,9 @@ int safe_unshare(const char *file, const int lineno, int flags);
601
577
int safe_setns (const char * file , const int lineno , int fd , int nstype );
602
578
#define SAFE_SETNS (fd , nstype ) safe_setns(__FILE__, __LINE__, (fd), (nstype))
603
579
604
- static inline void safe_cmd (const char * file , const int lineno , const char * const argv [],
605
- const char * stdout_path , const char * stderr_path )
606
- {
607
- int rval ;
580
+ void safe_cmd (const char * file , const int lineno , const char * const argv [],
581
+ const char * stdout_path , const char * stderr_path );
608
582
609
- switch ((rval = tst_cmd (argv , stdout_path , stderr_path ,
610
- TST_CMD_PASS_RETVAL | TST_CMD_TCONF_ON_MISSING ))) {
611
- case 0 :
612
- break ;
613
- default :
614
- tst_brk (TBROK , "%s:%d: %s failed (%d)" , file , lineno , argv [0 ], rval );
615
- }
616
- }
617
583
#define SAFE_CMD (argv , stdout_path , stderr_path ) \
618
584
safe_cmd(__FILE__, __LINE__, (argv), (stdout_path), (stderr_path))
619
585
/*
0 commit comments