diff options
author | Günther Deschner <gd@samba.org> | 2009-02-02 17:24:28 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-02-04 17:47:07 +0100 |
commit | de7f0a70c8293f1b87f9c821f16fd3c6f7b184b7 (patch) | |
tree | 4e51847a540e1701481e377764c48322dd842f68 /source3/utils | |
parent | 16f83ae75003107084c50b8e45d1922889158d80 (diff) | |
download | samba-de7f0a70c8293f1b87f9c821f16fd3c6f7b184b7.tar.gz samba-de7f0a70c8293f1b87f9c821f16fd3c6f7b184b7.tar.bz2 samba-de7f0a70c8293f1b87f9c821f16fd3c6f7b184b7.zip |
s3-eventlogadm: use struct eventlog_Record_tdb for storing entries in tdbs.
Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/eventlogadm.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c index b957ec2fab..d134ea8fea 100644 --- a/source3/utils/eventlogadm.c +++ b/source3/utils/eventlogadm.c @@ -5,6 +5,7 @@ * * * Copyright (C) Brian Moran 2005. + * Copyright (C) Guenther Deschner 2009. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,12 +85,13 @@ static int DoWriteCommand( int argc, char **argv, bool debugflag, char *exename FILE *f1; char *argfname; ELOG_TDB *etdb; + NTSTATUS status; /* fixed constants are bad bad bad */ char linein[1024]; bool is_eor; - Eventlog_entry ee; - int rcnum; + struct eventlog_Record_tdb ee; + uint32_t record_number; TALLOC_CTX *mem_ctx = talloc_tos(); f1 = stdin; @@ -128,22 +130,25 @@ static int DoWriteCommand( int argc, char **argv, bool debugflag, char *exename /* should we do something with the return code? */ if ( is_eor ) { - fixup_eventlog_entry( &ee ); + fixup_eventlog_record_tdb( &ee ); if ( opt_debug ) - printf( "record number [%d], tg [%d] , tw [%d]\n", ee.record.record_number, ee.record.time_generated, ee.record.time_written ); + printf( "record number [%d], tg [%d] , tw [%d]\n", + ee.record_number, (int)ee.time_generated, (int)ee.time_written ); - if ( ee.record.time_generated != 0 ) { + if ( ee.time_generated != 0 ) { /* printf("Writing to the event log\n"); */ - rcnum = write_eventlog_tdb( ELOG_TDB_CTX(etdb), &ee ); - if ( !rcnum ) { - printf( "Can't write to the event log\n" ); + status = evlog_push_record_tdb( mem_ctx, ELOG_TDB_CTX(etdb), + &ee, &record_number ); + if ( !NT_STATUS_IS_OK(status) ) { + printf( "Can't write to the event log: %s\n", + nt_errstr(status) ); } else { if ( opt_debug ) printf( "Wrote record %d\n", - rcnum ); + record_number ); } } else { if ( opt_debug ) |