diff --git a/servers/slapd/logging.c b/servers/slapd/logging.c index 89405f827c..485387f8a1 100644 --- a/servers/slapd/logging.c +++ b/servers/slapd/logging.c @@ -123,8 +123,9 @@ logfile_open( const char *path ) return errno; if ( fstat( fd, &st ) ) { + int saved_errno = errno; close( fd ); - return errno; + return saved_errno; } if ( !logfile_path[0] ) {