Re: [PATCH 1/2] logsys: Log error if blackbox cannot be created

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

 



ACK

Chrissie

On 27/05/14 16:37, Jan Friesse wrote:
Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
  exec/main.c |    6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/exec/main.c b/exec/main.c
index 17ebcf5..8cf551e 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -196,6 +196,7 @@ static void corosync_blackbox_write_to_file (void)
  	char time_str[PATH_MAX];
  	struct tm cur_time_tm;
  	time_t cur_time_t;
+	ssize_t res;

  	cur_time_t = time(NULL);
  	localtime_r(&cur_time_t, &cur_time_tm);
@@ -206,8 +207,9 @@ static void corosync_blackbox_write_to_file (void)
  	    time_str,
  	    (long long int)getpid());

-	qb_log_blackbox_write_to_file(fname);
-
+	if ((res = qb_log_blackbox_write_to_file(fname)) < 0) {
+		LOGSYS_PERROR(-res, LOGSYS_LEVEL_ERROR, "Can't store blackbox file");
+	}
  	unlink(LOCALSTATEDIR "/lib/corosync/fdata");
  	if (symlink(fname, LOCALSTATEDIR "/lib/corosync/fdata") == -1) {
  		log_printf(LOGSYS_LEVEL_ERROR, "Can't create symlink to '%s' for corosync blackbox file '%s'",


_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss




[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux