Deleted Added
sdiffudifftextold (d0fa49b78d1f40d84ec76c363cdc38cf128511dd)new (406d6273..)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 9 unchanged lines hidden (view full) ---

18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26
27/*
28 * Main processor for auditreduce.
29 * Mproc() is the entry point for this module. It is the only visible
30 * function in this module.
31 */
32
33#include <sys/types.h>
34#include <locale.h>

--- 442 unchanged lines hidden (view full) ---

477 (void) fprintf(stderr, "get_recs: %d ret %d recno %d\n",
478 pcb->pcb_procno, ret, pcb->pcb_nrecs + 1);
479#endif
480 /*
481 * See if entire file is after the time window specified.
482 * Must be check here because the start time of the file name
483 * may be after the first record(s).
484 */
485 if (pcb->pcb_nrecs == 0 && (pcb->pcb_flags & PF_FILE)) {
486 /*
487 * If the first record read failed then use the time
488 * that was in the filename to judge.
489 */
490 if (ret > 0)
491 (pcb->pcb_cur)->fcb_start = secs;
492 if (!f_all && (m_before <= (pcb->pcb_cur)->fcb_start)) {
493 (void) fclose(pcb->pcb_fpr); /* ignore file */

--- 10 unchanged lines hidden (view full) ---

504 }
505 }
506 /* Succesful acquisition of a record. */
507 if (ret > 0) {
508 pcb->pcb_time = secs; /* time of record */
509 pcb->pcb_nrecs++; /* # of read recs from stream */
510 nrecs++; /* # of recs read this call */
511 /* Only check record if at bottom of process tree. */
512 if (pcb->pcb_flags & PF_FILE) {
513 check_order(pcb); /* check time sequence */
514 if ((ret2 = check_rec(pcb)) == 0) {
515 pcb->pcb_nprecs++;
516 getrec = FALSE;
517 } else if (ret2 == -2) {
518 /* error */
519 getrec = FALSE; /* get no more recs */
520 alldone = TRUE; /* quit this file */

--- 15 unchanged lines hidden (view full) ---

536 if (alldone == TRUE) {
537#if AUDIT_FILE
538 get_trace(pcb);
539#endif
540 /* Error in record read. Display messages. */
541 if (ret < 0 || ret2 == -2) {
542 pcb->pcb_nrecs++; /* # of read records */
543 if (!f_quiet) {
544 if (pcb->pcb_flags & PF_FILE) {
545 /* Ignore if this is not_terminated. */
546 if (!strstr((pcb->pcb_cur)->fcb_file,
547 "not_terminated")) {
548(void) fprintf(stderr, gettext("%s read error in %s at record %d.\n"), ar,
549 (pcb->pcb_cur)->fcb_file, pcb->pcb_nrecs);
550 }
551 } else {
552(void) fprintf(stderr, gettext("%s read error in pipe at record %d.\n"), ar,
553 pcb->pcb_nrecs);
554 }
555 }
556 } else {
557 /*
558 * Only mark infile for deleting if we have succesfully
559 * processed all of it.
560 */
561 if (pcb->pcb_flags & PF_FILE)
562 (pcb->pcb_cur)->fcb_flags |= FF_DELETE;
563 }
564 if (fclose(pcb->pcb_fpr) == EOF) {
565 if (!f_quiet) {
566 if (pcb->pcb_flags & PF_FILE) {
567 str = (pcb->pcb_cur)->fcb_file;
568 } else {
569 str = "pipe";
570 }
571 (void) fprintf(stderr,
572 gettext("%s couldn't close %s.\n"),
573 ar, str);
574 }

--- 20 unchanged lines hidden (view full) ---

595 */
596static void
597get_trace(pcb)
598audit_pcb_t *pcb;
599{
600 /*
601 * For file give filename, too.
602 */
603 if (pcb->pcb_flags & PF_FILE) {
604 (void) fprintf(stderr, "%s closed %s: %d records read recs: \
605 %d record written.\n", ar, (pcb->pcb_cur)->fcb_file,
606 pcb->pcb_nrecs, pcb->pcb_nprecs);
607 } else {
608 (void) fprintf(stderr, "%s closed pipe: %d records read: \
609 %d records written .\n", ar, pcb->pcb_nrecs,
610 pcb->pcb_nprecs);
611 }

--- 437 unchanged lines hidden ---