[vhffs-dev] [1337] delete previous symlink if needed

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1337
Author:   gradator
Date:     2009-02-16 19:44:31 +0100 (Mon, 16 Feb 2009)

Log Message:
-----------
delete previous symlink if needed

Modified Paths:
--------------
    trunk/vhffs-fssync/vhffsfssync_slave.c


Modified: trunk/vhffs-fssync/vhffsfssync_slave.c
===================================================================
--- trunk/vhffs-fssync/vhffsfssync_slave.c	2009-02-08 03:34:53 UTC (rev 1336)
+++ trunk/vhffs-fssync/vhffsfssync_slave.c	2009-02-16 18:44:31 UTC (rev 1337)
@@ -406,6 +406,10 @@
 	else if(!strcmp(args[0], "symlink")) {
 		char *from = args[1];
 		char *to = args[2];
+		struct stat st;
+		if(! lstat(from, &st) )  {
+			vhffsfssync_remove(from);
+		}
 		if( symlink(to, from) )  {
 			fprintf(stderr, "symlink() failed on %s -> %s: %s\n", from, to, strerror(errno));
 		}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/