Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
c8cf2fc4
Commit
c8cf2fc4
authored
Mar 26, 2009
by
Rein Tollevik
Browse files
ITS#6038: Write slapadd progress meter to stdout.
parent
3e57c96a
Changes
2
Hide whitespace changes
Inline
Side-by-side
libraries/liblutil/meter.c
View file @
c8cf2fc4
...
...
@@ -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
=
std
err
;
data
->
output
=
std
out
;
*
display_datap
=
data
;
return
0
;
}
...
...
@@ -314,6 +314,7 @@ text_update (
(
void
)
fprintf
(
data
->
output
,
"
\r
%-79s"
,
data
->
buffer
);
(
void
)
fflush
(
data
->
output
);
data
->
need_eol
=
1
;
return
0
;
}
...
...
servers/slapd/slapadd.c
View file @
c8cf2fc4
...
...
@@ -76,7 +76,7 @@ slapadd( int argc, char **argv )
/* default "000" */
csnsid
=
0
;
if
(
isatty
(
2
)
)
enable_meter
=
1
;
if
(
isatty
(
1
)
)
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
(
std
err
,
"Closing DB..."
);
fprintf
(
std
out
,
"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
(
std
err
,
"
\n
"
);
fprintf
(
std
out
,
"
\n
"
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment