Re: [RHEL6-BRANCH] Redirect uncpio errors to syslog (#588671)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/11/2010 11:40 PM, Brian C. Lane wrote:
This assumes that openlog has already been called.

These functions are curently only used by loader, which calls openlog
before calling the uncpio functions.

Resolves: rhbz#588671
---
  isys/uncpio.c |    5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/isys/uncpio.c b/isys/uncpio.c
index 171eb6b..c65ad0f 100644
--- a/isys/uncpio.c
+++ b/isys/uncpio.c
@@ -36,6 +36,7 @@
  #include<sys/stat.h>
  #include<unistd.h>
  #include<utime.h>
+#include<syslog.h>

  #include "cpio.h"
  #include "stubs.h"
@@ -504,7 +505,7 @@ int myCpioInstallArchive(gzFile stream, struct cpioFileMapping * mappings,

      do {
  	if ((rc = getNextHeader(&fd,&ch, NULL))) {
-	    fprintf(stderr, _("error %d reading header: %s\n"), rc,
+	    syslog( LOG_WARNING, _("error %d reading header: %s\n"), rc,
  		    myCpioStrerror(rc));
  	    return CPIOERR_BAD_HEADER;
  	}
@@ -755,7 +756,7 @@ int myCpioFilterArchive(gzFile inStream, gzFile outStream, char ** patterns) {

      do {
  	if ((rc = getNextHeader(&inFd,&ch,&pHeader))) {
-	    fprintf(stderr, _("error %d reading header: %s\n"), rc,
+	    syslog( LOG_WARNING, _("error %d reading header: %s\n"), rc,
  		    myCpioStrerror(rc));
  	    return CPIOERR_BAD_HEADER;
  	}

Ack for rhel6.

For teh rawhide I think you should use the logging facilities in isys/log.h. The method that initializes the log there is 'openLog' (note the upper case), but your argument that the logging was initialized beforehand should still hold.

Ales






_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux