diff -u -r upsream-cvs/xinetd/builtins.c cvs-build/xinetd/builtins.c
--- upsream-cvs/xinetd/builtins.c	2003-02-19 12:29:27.000000000 -0500
+++ cvs-build/xinetd/builtins.c	2003-04-15 12:09:00.000000000 -0400
@@ -160,7 +160,7 @@
          break ;
    }
    if( SVC_WAITS( svc ) )
-      close(descriptor);
+      Sclose(descriptor);
 }
 
 /* For internal UDP services, make sure we don't respond to our ports
@@ -221,7 +221,7 @@
          break ;
    }
    if( SVC_WAITS( svc ) )
-      close(descriptor);
+      Sclose(descriptor);
 }
 
 
@@ -288,7 +288,7 @@
    }
    daytime_protocol( time_buf, &buflen ) ;
    (void) write_buf( descriptor, time_buf, buflen ) ;
-   close(descriptor);
+   Sclose(descriptor);
 }
 
 
@@ -352,7 +352,7 @@
    time_protocol( time_buf ) ;
    (void) write_buf( descriptor, (char *) time_buf, 4 ) ;
 
-   close(descriptor);
+   Sclose(descriptor);
 }
 
 
@@ -451,7 +451,7 @@
          break ;
    }
    if( SVC_WAITS( svc ) )
-      close(descriptor);
+      Sclose(descriptor);
 }
 
 
@@ -637,7 +637,7 @@
    }
 
    if( SVC_WAITS( svc ) )
-      close(descriptor);
+      Sclose(descriptor);
 
    server.svr_sp = sp;
    server.svr_conn = serp->svr_conn;
@@ -690,7 +690,7 @@
       {
          Sprint(descriptor, "bye bye\n");
          Sflush(descriptor);
-         close(descriptor);
+         Sclose(descriptor);
          exit(0);
       }
 
diff -u -r upsream-cvs/xinetd/child.c cvs-build/xinetd/child.c
--- upsream-cvs/xinetd/child.c	2003-03-27 14:55:55.000000000 -0500
+++ cvs-build/xinetd/child.c	2003-04-15 12:09:00.000000000 -0400
@@ -134,7 +134,7 @@
    }
 #endif
 
-   (void) close( descriptor ) ;
+   (void) Sclose( descriptor ) ;
 
 #ifndef solaris
    no_control_tty() ;
@@ -274,8 +274,8 @@
 
    signal_default_state();
 
-   if ((signals_pending[0] >= 0 && close(signals_pending[0])) ||
-       (signals_pending[1] >= 0 && close(signals_pending[1])))
+   if ((signals_pending[0] >= 0 && Sclose(signals_pending[0])) ||
+       (signals_pending[1] >= 0 && Sclose(signals_pending[1])))
    {
       msg(LOG_ERR, func, "Failed to close the signal pipe: %m");
       _exit(1);
@@ -283,9 +283,9 @@
    signals_pending[0] = -1;
    signals_pending[1] = -1;
 
-   close(0);
-   close(1);
-   close(2);
+   Sclose(0);
+   Sclose(1);
+   Sclose(2);
 
 
 #ifdef DEBUG_SERVER
diff -u -r upsream-cvs/xinetd/conf.c cvs-build/xinetd/conf.c
--- upsream-cvs/xinetd/conf.c	2003-02-19 12:29:27.000000000 -0500
+++ cvs-build/xinetd/conf.c	2003-04-15 12:09:00.000000000 -0400
@@ -99,7 +99,7 @@
    if ( ( pset = pset_create( 0, 0 ) ) == NULL )
    {
       msg( LOG_CRIT, func, "can't create service table" ) ;
-      (void) close( fd ) ;
+      (void) Sclose( fd ) ;
       return( FAILED ) ;
    }
 
@@ -107,7 +107,7 @@
    {
       msg( LOG_ERR, func, "can't allocate defaults service" ) ;
       pset_destroy( pset ) ;
-      (void) close( fd ) ;
+      (void) Sclose( fd ) ;
       return( FAILED ) ;
    }
 
@@ -116,7 +116,7 @@
       msg( LOG_ERR, func, "can't create service table iterator" ) ;
       sc_free( scp ) ;
       pset_destroy( pset ) ;
-      (void) close( fd ) ;
+      (void) Sclose( fd ) ;
       return( FAILED ) ;
    }
 
diff -u -r upsream-cvs/xinetd/confparse.c cvs-build/xinetd/confparse.c
--- upsream-cvs/xinetd/confparse.c	2003-03-27 14:55:55.000000000 -0500
+++ cvs-build/xinetd/confparse.c	2003-04-15 12:09:00.000000000 -0400
@@ -821,7 +821,7 @@
 
    else if ( get_conf( config_fd, confp ) == FAILED )
    {
-      close( config_fd ) ;
+      Sclose( config_fd ) ;
       cnf_free( confp ) ;
       psi_destroy( iter ) ;
       return( FAILED ) ;
diff -u -r upsream-cvs/xinetd/ident.c cvs-build/xinetd/ident.c
--- upsream-cvs/xinetd/ident.c	2003-03-27 14:55:55.000000000 -0500
+++ cvs-build/xinetd/ident.c	2003-04-15 12:09:00.000000000 -0400
@@ -124,7 +124,7 @@
    if ( fcntl( sd, F_SETFD, FD_CLOEXEC ) == -1 )
    {
       msg( LOG_ERR, func, "fcntl F_SETFD: %m" ) ;
-      (void) close( sd ) ;
+      (void) Sclose( sd ) ;
       return( IDR_ERROR ) ;
    }
 
@@ -132,7 +132,7 @@
       if ( sigsetjmp( env, 1 ) == 0 )
          START_TIMER( timeout ) ;
       else {
-         close( sd ) ;
+         Sclose( sd ) ;
          return( IDR_TIMEDOUT ) ;
       }
    }
@@ -143,7 +143,7 @@
          STOP_TIMER() ;
          signal ( SIGALRM, SIG_DFL ) ;
       }
-      close( sd );
+      Sclose( sd );
       return( IDR_NOSERVER ) ;
    }
 
@@ -155,7 +155,7 @@
          STOP_TIMER() ;
          signal ( SIGALRM, SIG_DFL ) ;
       }
-      close( sd );
+      Sclose( sd );
       return( IDR_ERROR ) ;
    }
 
@@ -167,7 +167,7 @@
    }
 
    if ( p == NULL ) {
-      close( sd );
+      Sclose( sd );
       return( IDR_RESPERR ) ;
    }
    
@@ -178,7 +178,7 @@
    {
       msg(LOG_ERR, func, "Bad line received from identity server at %s: %s",
          xaddrname( &sin_remote ), buf ) ;
-      close( sd );
+      Sclose( sd );
       return( IDR_BADRESP ) ;
    }
 
diff -u -r upsream-cvs/xinetd/init.c cvs-build/xinetd/init.c
--- upsream-cvs/xinetd/init.c	2003-02-19 12:29:27.000000000 -0500
+++ cvs-build/xinetd/init.c	2003-04-15 12:09:00.000000000 -0400
@@ -99,7 +99,7 @@
     * Close all unneeded descriptors
     */
    for ( fd = STDERR_FD + 1 ; fd < ps.ros.max_descriptors ; fd++ )
-      if ( close( fd ) && errno != EBADF )
+      if ( Sclose( fd ) && errno != EBADF )
       {
          msg( LOG_CRIT, func, "close: %m" ) ;
          exit( 1 ) ;
@@ -112,7 +112,7 @@
    if ( new_fd != -1 )
    {
       have_stderr = TRUE ;
-      (void) close( new_fd ) ;
+      (void) Sclose( new_fd ) ;
    }
 
    if ( ( null_fd = open( "/dev/null", O_RDONLY ) ) == -1 )
@@ -127,7 +127,7 @@
    }
 
    if ( null_fd > MAX_PASS_FD )
-      (void) close( null_fd ) ;
+      (void) Sclose( null_fd ) ;
 }
 
 
@@ -259,7 +259,7 @@
                   fclose(pidfile);
                } else {
                   perror("fdopen");
-                  close(pidfd);
+                  Sclose(pidfd);
                }
             } else
                perror("open");
diff -u -r upsream-cvs/xinetd/intcommon.c cvs-build/xinetd/intcommon.c
--- upsream-cvs/xinetd/intcommon.c	2003-02-19 12:29:28.000000000 -0500
+++ cvs-build/xinetd/intcommon.c	2003-04-15 12:09:00.000000000 -0400
@@ -108,7 +108,7 @@
          continue ;
       if ( LOG_GET_TYPE( SC_LOG( SVC_CONF( sp ) ) ) == L_FILE )
          xlog_destroy( sp->svc_log ) ;
-      (void) close( SVC_FD( sp ) ) ;
+      (void) Sclose( SVC_FD( sp ) ) ;
    }
 
    /*
@@ -165,7 +165,7 @@
    if ( connect( sd, SA( local ), sizeof( *local ) ) == -1 )
    {
       msg( LOG_ERR, func, "(intercepting %s) connect failed: %m", sid ) ;
-      (void) close( sd ) ;
+      (void) Sclose( sd ) ;
       return( CHANNEL_NULL ) ;
    }
 
@@ -173,7 +173,7 @@
    if ( chp == CHANNEL_NULL )
    {
       msg( LOG_ERR, func, ES_NOMEM ) ;
-      (void) close( sd ) ;
+      (void) Sclose( sd ) ;
       return( CHANNEL_NULL ) ;
    }
 
@@ -181,7 +181,7 @@
    {
       msg( LOG_ERR, func, ES_NOMEM ) ;
       FREE_CHANNEL( chp ) ;
-      (void) close( sd ) ;
+      (void) Sclose( sd ) ;
       return( CHANNEL_NULL ) ;
    }
 
diff -u -r upsream-cvs/xinetd/redirect.c cvs-build/xinetd/redirect.c
--- upsream-cvs/xinetd/redirect.c	2003-02-19 12:29:28.000000000 -0500
+++ cvs-build/xinetd/redirect.c	2003-04-15 12:09:01.000000000 -0400
@@ -44,7 +44,7 @@
  */
 static void redir_sigpipe( int signum ) 
 {
-   close(RedirServerFd);
+   Sclose(RedirServerFd);
    _exit(0);
 }
 
diff -u -r upsream-cvs/xinetd/service.c cvs-build/xinetd/service.c
--- upsream-cvs/xinetd/service.c	2003-04-15 13:12:57.000000000 -0400
+++ cvs-build/xinetd/service.c	2003-04-15 15:32:07.000000000 -0400
@@ -335,7 +335,7 @@
 
    if ( set_fd_modes( sp ) == FAILED )
    {
-      (void) close( sp->svc_fd ) ;
+      (void) Sclose( sp->svc_fd ) ;
       return( FAILED ) ;
    }
 
@@ -348,7 +348,7 @@
    
    if ( status == FAILED )
    {
-      (void) close( sp->svc_fd ) ;
+      (void) Sclose( sp->svc_fd ) ;
       return( FAILED ) ;
    }
 
@@ -396,7 +396,7 @@
 
 static void deactivate( const struct service *sp )
 {
-   (void) close( SVC_FD( sp ) ) ;
+   (void) Sclose( SVC_FD( sp ) ) ;
 
 #ifdef HAVE_DNSREGISTRATION
    if( SVC_CONF(sp)->sc_mdnscon )
@@ -635,8 +635,8 @@
             }
          }
          Swrite(cp->co_descriptor, tmpbuf, retval);
-         Sflush(cp->co_descriptor);
       }
+      Sflush(cp->co_descriptor);
 
       Sclose(bannerfd);
    }
@@ -676,8 +676,8 @@
             }
          }
          Swrite(cp->co_descriptor, tmpbuf, retval);
-         Sflush(cp->co_descriptor);
       }
+      Sflush(cp->co_descriptor);
 
       Sclose(bannerfd);
    }
@@ -715,8 +715,8 @@
             }
          }
          Swrite(cp->co_descriptor, tmpbuf, retval);
-         Sflush(cp->co_descriptor);
       }
+      Sflush(cp->co_descriptor);
 
       Sclose(bannerfd);
    }
diff -u -r upsream-cvs/xinetd/tcpint.c cvs-build/xinetd/tcpint.c
--- upsream-cvs/xinetd/tcpint.c	2003-02-19 12:29:28.000000000 -0500
+++ cvs-build/xinetd/tcpint.c	2003-04-15 12:09:01.000000000 -0400
@@ -180,8 +180,8 @@
 
          FD_CLR( chp->ch_local_socket, maskp ) ;
          FD_CLR( chp->ch_remote_socket, maskp ) ;
-         (void) close( chp->ch_remote_socket ) ;
-         (void) close( chp->ch_local_socket ) ;
+         (void) Sclose( chp->ch_remote_socket ) ;
+         (void) Sclose( chp->ch_local_socket ) ;
          psi_remove( iter ) ;
          FREE_CHANNEL( chp ) ;
          break ;
@@ -236,14 +236,14 @@
          if ( result != AC_OK )
          {
             svc_log_failure( sp, cop, result ) ;
-            (void) close( sd ) ;
+            (void) Sclose( sd ) ;
             return ;
          }
       }
 
       if ( ( chp = int_newconn( ip, &csin, sd ) ) == NULL )
       {
-         (void) close( sd ) ;
+         (void) Sclose( sd ) ;
          return ;
       }
       
