]> git.sur5r.net Git - openldap/commitdiff
ITS#6038 revert prev commits, ITS rejected
authorHoward Chu <hyc@openldap.org>
Fri, 27 Mar 2009 11:07:42 +0000 (11:07 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 27 Mar 2009 11:07:42 +0000 (11:07 +0000)
libraries/liblutil/meter.c
servers/slapd/slapadd.c

index 15e6832bb697803df8365a2ffd3ea108e3d8bdb7..0bbbdc03078b4fcc605cfe838ea42c0d7b7e16cf 100644 (file)
@@ -214,7 +214,7 @@ text_open (void ** display_datap)
        data->buffer_length = default_buffer_length;
        data->buffer = calloc( 1, default_buffer_length );
        assert( data->buffer != NULL );
-       data->output = stdout;
+       data->output = stderr;
        *display_datap = data;
        return 0;
 }
@@ -314,7 +314,6 @@ text_update (
        (void) fprintf( data->output,
                        "\r%-79s", 
                        data->buffer );
-       (void) fflush( data->output );
        data->need_eol = 1;
        return 0;
 }
index 38d5b89253aeb06ff0071f892881b11ac5f6080f..a6cf3a2e219e52c05416564903a6b123b28a546b 100644 (file)
@@ -76,7 +76,7 @@ slapadd( int argc, char **argv )
        /* default "000" */
        csnsid = 0;
 
-       if ( isatty (1) ) enable_meter = 1;
+       if ( isatty (2) ) enable_meter = 1;
        slap_tool_init( progname, SLAPADD, argc, argv );
 
        memset( &opbuf, 0, sizeof(opbuf) );
@@ -506,7 +506,7 @@ slapadd( int argc, char **argv )
 
        if ( !dryrun ) {
                if ( enable_meter ) {
-                       fprintf( stdout, "Closing DB..." );
+                       fprintf( stderr, "Closing DB..." );
                }
                if( be->be_entry_close( be ) ) {
                        rc = EXIT_FAILURE;
@@ -516,7 +516,7 @@ slapadd( int argc, char **argv )
                        be->be_sync( be );
                }
                if ( enable_meter ) {
-                       fprintf( stdout, "\n" );
+                       fprintf( stderr, "\n" );
                }
        }