[PATCH 3/3] Properly check result of symlink

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

 



Error message is displayed when it's impossible to create symlink to
fdata file.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/exec/main.c b/exec/main.c
index 322e9ff..17ebcf5 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -209,7 +209,10 @@ static void corosync_blackbox_write_to_file (void)
 	qb_log_blackbox_write_to_file(fname);
 
 	unlink(LOCALSTATEDIR "/lib/corosync/fdata");
-	symlink(fname, 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'",
+		    fname, LOCALSTATEDIR "/lib/corosync/fdata");
+	}
 }
 
 static void unlink_all_completed (void)
-- 
1.7.1

_______________________________________________
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