Print this page
11972 resync smatch
*** 23,32 ****
--- 23,36 ----
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
+ * Copyright 2019 Joyent, Inc.
+ */
+
+ /*
* The Secure SunOS audit reduction tool - auditreduce.
* Document SM0071 is the primary source of information on auditreduce.
*
* Composed of 4 source modules:
* main.c - main driver.
*** 245,259 ****
}
/*
* Convert descriptors to streams.
*/
if ((pcbn->pcb_fpr = fdopen(fildes[0], "r")) == NULL) {
! perror(gettext("auditreduce: couldn't get read stream for pipe"));
return (-1);
}
if ((pcbn->pcb_fpw = fdopen(fildes[1], "w")) == NULL) {
! perror(gettext("auditreduce: couldn't get write stream for pipe"));
return (-1);
}
if ((procno = fork()) == -1) {
perror(gettext("auditreduce: fork failed"));
return (-1);
--- 249,265 ----
}
/*
* Convert descriptors to streams.
*/
if ((pcbn->pcb_fpr = fdopen(fildes[0], "r")) == NULL) {
! perror(gettext("auditreduce: couldn't get read "
! "stream for pipe"));
return (-1);
}
if ((pcbn->pcb_fpw = fdopen(fildes[1], "w")) == NULL) {
! perror(gettext("auditreduce: couldn't get "
! "write stream for pipe"));
return (-1);
}
if ((procno = fork()) == -1) {
perror(gettext("auditreduce: fork failed"));
return (-1);
*** 398,410 ****
* Do all pcbs in parent's group up to and including us
*/
for (j = 0; j <= i; j++) {
pcbt = &pcb->pcb_below[j];
if (fclose(pcbt->pcb_fpr) == EOF) {
! if (!f_quiet)
! perror(gettext("auditreduce: initial close on pipe failed"));
}
/*
* Free the buffer allocated to hold incoming records.
*/
if (i != j) {
free(pcbt->pcb_rec);
--- 404,418 ----
* Do all pcbs in parent's group up to and including us
*/
for (j = 0; j <= i; j++) {
pcbt = &pcb->pcb_below[j];
if (fclose(pcbt->pcb_fpr) == EOF) {
! if (!f_quiet) {
! perror(gettext("auditreduce: initial close "
! "on pipe failed"));
}
+ }
/*
* Free the buffer allocated to hold incoming records.
*/
if (i != j) {
free(pcbt->pcb_rec);
*** 424,436 ****
*/
static void
p_close(audit_pcb_t *pcbn)
{
if (fclose(pcbn->pcb_fpw) == EOF) {
! if (!f_quiet)
! perror(gettext("auditreduce: close for write pipe failed"));
}
}
/*
* .func audit_stats - print statistics.
--- 432,446 ----
*/
static void
p_close(audit_pcb_t *pcbn)
{
if (fclose(pcbn->pcb_fpw) == EOF) {
! if (!f_quiet) {
! perror(gettext("auditreduce: close for write "
! "pipe failed"));
}
+ }
}
/*
* .func audit_stats - print statistics.