From 15fffedad73950daace0a4934859415b3fe14f6b Mon Sep 17 00:00:00 2001 From: Julius Enarusai Date: Mon, 15 Apr 2002 20:40:15 +0000 Subject: [PATCH] Added LDAP_LOG Messages --- servers/slurpd/replog.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/servers/slurpd/replog.c b/servers/slurpd/replog.c index 73f1d32716..a93f9040d5 100644 --- a/servers/slurpd/replog.c +++ b/servers/slurpd/replog.c @@ -57,9 +57,14 @@ copy_replog( static char rbuf[ 1024 ]; char *p; +#ifdef NEW_LOGGING + LDAP_LOG (( "replog", LDAP_LEVEL_ARGS, "copy_replog: " + "copy replog \"%s\" to \"%s\"\n", src, dst )); +#else Debug( LDAP_DEBUG_ARGS, "copy replog \"%s\" to \"%s\"\n", src, dst, 0 ); +#endif /* * Make sure the destination directory is writable. If not, exit @@ -72,9 +77,15 @@ copy_replog( *p = '\0'; } if ( access( buf, W_OK ) < 0 ) { +#ifdef NEW_LOGGING + LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + "Error: (%ld): Directory %s is not writable\n", + (long) getpid(), buf )); +#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog (%ld): Directory %s is not writable\n", (long) getpid(), buf, 0 ); +#endif return( -1 ); } strcpy( buf, dst ); @@ -84,27 +95,45 @@ copy_replog( *p = '\0'; } if ( access( buf, W_OK ) < 0 ) { +#ifdef NEW_LOGGING + LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + "Error: (%ld): Directory %s is not writable\n", + (long) getpid(), buf )); +#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog (%ld): Directory %s is not writable\n", (long) getpid(), buf, 0 ); +#endif return( -1 ); } /* lock src */ rfp = lock_fopen( src, "r", &lfp ); if ( rfp == NULL ) { +#ifdef NEW_LOGGING + LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + "Error: Can't lock replog \"%s\" for read: %s\n", + src, sys_errlist[ errno ] )); +#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for read: %s\n", src, sys_errlist[ errno ], 0 ); +#endif return( 1 ); } /* lock dst */ dfp = lock_fopen( dst, "a", &dlfp ); if ( dfp == NULL ) { +#ifdef NEW_LOGGING + LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + "Error: Can't lock replog \"%s\" for write: %s\n", + src, sys_errlist[ errno ] )); +#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for write: %s\n", src, sys_errlist[ errno ], 0 ); +#endif lock_fclose( rfp, lfp ); return( 1 ); } @@ -122,14 +151,24 @@ copy_replog( } if ( lock_fclose( dfp, dlfp ) == EOF ) { +#ifdef NEW_LOGGING + LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + "Error: Error closing \"%s\"\n", src )); +#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", src, 0, 0 ); +#endif } if ( lock_fclose( rfp, lfp ) == EOF ) { +#ifdef NEW_LOGGING + LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + "Error: Error closing \"%s\"\n", src )); +#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", src, 0, 0 ); +#endif } return( rc ); } -- 2.39.5