mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Fri Aug 18 14:27:14 CEST 2000 Werner Koch
This commit is contained in:
parent
7a8c8b4826
commit
c9c709545a
10 changed files with 184 additions and 16 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Aug 18 14:27:14 CEST 2000 Werner Koch <wk@openit.de>
|
||||
|
||||
* logger.c (log_set_file): Allow to set the file by name.
|
||||
|
||||
Fri Jul 28 18:19:11 CEST 2000 Werner Koch <wk@openit.de>
|
||||
|
||||
* iobuf.c: Use setmode() at several places to set stdin and stdout
|
||||
|
|
|
@ -41,17 +41,19 @@ static FILE *logfp;
|
|||
void
|
||||
log_set_logfile( const char *name, int fd )
|
||||
{
|
||||
if( name )
|
||||
BUG();
|
||||
|
||||
if( logfp && logfp != stderr && logfp != stdout )
|
||||
fclose( logfp );
|
||||
if( fd == 1 )
|
||||
logfp = stdout;
|
||||
else if( fd == 2 )
|
||||
logfp = stderr;
|
||||
else
|
||||
logfp = fdopen( fd, "a" );
|
||||
fclose( logfp );
|
||||
if( name ) {
|
||||
logfp = fopen ( name, "a" );
|
||||
}
|
||||
else {
|
||||
if( fd == 1 )
|
||||
logfp = stdout;
|
||||
else if( fd == 2 )
|
||||
logfp = stderr;
|
||||
else
|
||||
logfp = fdopen( fd, "a" );
|
||||
}
|
||||
if( !logfp ) {
|
||||
logfp = stderr;
|
||||
log_fatal("can't open fd %d for logging: %s\n", fd, strerror(errno));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue