aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Kendall <wkendall@sgi.com>2011-08-04 22:30:05 +0000
committerAlex Elder <aelder@sgi.com>2011-08-09 16:00:17 -0500
commit9e40e3207015a9c0df0786bf0149a642f4e5b6ea (patch)
tree8a3d4ec8759bdb0dd3c03c85f08aac174208a183
parent5e127af43be3c31198d1dcf616958af19321dcd9 (diff)
downloadxfsdump-dev-9e40e3207015a9c0df0786bf0149a642f4e5b6ea.tar.gz
xfsdump: remove conditional OPENMASKED code
xfsdump contains a couple wrapper functions which block signals during an open(2) call. This code is conditionally compiled and has not been enabled for a long time. Remove the wrappers rather than converting them to use the POSIX signal API. Signed-off-by: Bill Kendall <wkendall@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
-rw-r--r--common/drive_minrmt.c58
-rw-r--r--common/drive_scsitape.c58
2 files changed, 4 insertions, 112 deletions
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 94795e24..eb7876a4 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -24,11 +24,9 @@
#include <sys/sem.h>
#include <sys/prctl.h>
#include <time.h>
-#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/sysmacros.h>
-#include <sys/signal.h>
#include <malloc.h>
#include <sched.h>
@@ -59,12 +57,6 @@
/* remote tape protocol debug
*/
-#ifdef OPENMASKED
-static intgen_t open_masked_signals( char *path, int oflags );
-#else /* OPENMASKED */
-#define open_masked_signals(p,f) open(p,f)
-#endif /* OPENMASKED */
-
#ifdef RMT
#ifdef RMTDBG
#define open(p,f) dbgrmtopen(p,f)
@@ -455,7 +447,7 @@ ds_match( int argc, char *argv[], drive_t *drivep, bool_t singlethreaded )
}
cmdlineblksize = ( u_int32_t )atoi( optarg );
errno = 0;
- fd = open_masked_signals( drivep->d_pathname, O_RDONLY );
+ fd = open( drivep->d_pathname, O_RDONLY );
if ( fd < 0 )
return -10;
close( fd );
@@ -3435,7 +3427,7 @@ Open( drive_t *drivep )
ASSERT( contextp->dc_fd == -1 );
errno = 0;
- contextp->dc_fd = open_masked_signals( drivep->d_pathname, oflags );
+ contextp->dc_fd = open( drivep->d_pathname, oflags );
if ( contextp->dc_fd <= 0 ) {
return BOOL_FALSE;
@@ -4039,49 +4031,3 @@ isxfsdumperasetape( drive_t *drivep )
else
return BOOL_FALSE;
}
-
-#ifdef OPENMASKED
-
-static intgen_t
-open_masked_signals( char *pathname, int oflags )
-{
- bool_t isrmtpr;
- SIG_PF sigalrm_save;
- SIG_PF sigint_save;
- SIG_PF sighup_save;
- SIG_PF sigquit_save;
- SIG_PF sigcld_save;
- intgen_t rval;
- intgen_t saved_errno;
-
- if ( strchr( pathname, ':') ) {
- isrmtpr = BOOL_TRUE;
- } else {
- isrmtpr = BOOL_FALSE;
- }
-
- if ( isrmtpr ) {
- sigalrm_save = sigset( SIGALRM, SIG_IGN );
- sigint_save = sigset( SIGINT, SIG_IGN );
- sighup_save = sigset( SIGHUP, SIG_IGN );
- sigquit_save = sigset( SIGQUIT, SIG_IGN );
- sigcld_save = sigset( SIGCLD, SIG_IGN );
- }
-
- errno = 0;
- rval = open( pathname, oflags );
- saved_errno = errno;
-
- if ( isrmtpr ) {
- ( void )sigset( SIGCLD, sigcld_save );
- ( void )sigset( SIGQUIT, sigquit_save );
- ( void )sigset( SIGHUP, sighup_save );
- ( void )sigset( SIGINT, sigint_save );
- ( void )sigset( SIGALRM, sigalrm_save );
- }
-
- errno = saved_errno;
- return rval;
-}
-
-#endif /* OPENMASKED */
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 0f034b71..d72ba695 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -24,11 +24,9 @@
#include <sys/sem.h>
#include <sys/prctl.h>
#include <time.h>
-#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/sysmacros.h>
-#include <sys/signal.h>
#include <malloc.h>
#include <sched.h>
@@ -55,12 +53,6 @@
/* remote tape protocol debug
*/
-#ifdef OPENMASKED
-static intgen_t open_masked_signals( char *path, int oflags );
-#else /* OPENMASKED */
-#define open_masked_signals(p,f) open(p,f)
-#endif /* OPENMASKED */
-
#ifdef RMT
#ifdef RMTDBG
#define open(p,f) dbgrmtopen(p,f)
@@ -539,7 +531,7 @@ ds_match( int argc, char *argv[], drive_t *drivep, bool_t singlethreaded )
if ( strchr( drivep->d_pathname, ':')) {
errno = 0;
- fd = open_masked_signals( drivep->d_pathname, O_RDONLY );
+ fd = open( drivep->d_pathname, O_RDONLY );
if ( fd < 0 ) {
return -10;
}
@@ -4682,7 +4674,7 @@ Open( drive_t *drivep )
ASSERT( contextp->dc_fd == -1 );
errno = 0;
- contextp->dc_fd = open_masked_signals( drivep->d_pathname, oflags );
+ contextp->dc_fd = open( drivep->d_pathname, oflags );
if ( contextp->dc_fd <= 0 ) {
return BOOL_FALSE;
@@ -5426,52 +5418,6 @@ isefsdump( drive_t *drivep )
}
}
-#ifdef OPENMASKED
-
-static intgen_t
-open_masked_signals( char *pathname, int oflags )
-{
- bool_t isrmtpr;
- SIG_PF sigalrm_save;
- SIG_PF sigint_save;
- SIG_PF sighup_save;
- SIG_PF sigquit_save;
- SIG_PF sigcld_save;
- intgen_t rval;
- intgen_t saved_errno;
-
- if ( strchr( pathname, ':') ) {
- isrmtpr = BOOL_TRUE;
- } else {
- isrmtpr = BOOL_FALSE;
- }
-
- if ( isrmtpr ) {
- sigalrm_save = sigset( SIGALRM, SIG_IGN );
- sigint_save = sigset( SIGINT, SIG_IGN );
- sighup_save = sigset( SIGHUP, SIG_IGN );
- sigquit_save = sigset( SIGQUIT, SIG_IGN );
- sigcld_save = sigset( SIGCLD, SIG_IGN );
- }
-
- errno = 0;
- rval = open( pathname, oflags );
- saved_errno = errno;
-
- if ( isrmtpr ) {
- ( void )sigset( SIGCLD, sigcld_save );
- ( void )sigset( SIGQUIT, sigquit_save );
- ( void )sigset( SIGHUP, sighup_save );
- ( void )sigset( SIGINT, sigint_save );
- ( void )sigset( SIGALRM, sigalrm_save );
- }
-
- errno = saved_errno;
- return rval;
-}
-
-#endif /* OPENMASKED */
-
/*
* General purpose routine which dredges through procfs trying to
* match up device driver names with the associated major numbers