diff -Naur installwatch-0.6.3/installwatch.c installwatch-0.6.3-new/installwatch.c
--- installwatch-0.6.3/installwatch.c	2001-12-23 00:37:06.000000000 +0100
+++ installwatch-0.6.3-new/installwatch.c	2004-01-08 01:58:25.000000000 +0100
@@ -134,7 +134,10 @@
 static void log(const char *format, ...) {
 	char buffer[BUFSIZE], *logname;
 	va_list ap;
-	int count, logfd;
+	int count, logfd, s_errno;
+
+	/* save errno */
+	s_errno = errno;
 
 	va_start(ap, format);
 	count = vsnprintf(buffer, BUFSIZE, format, ap);
@@ -156,9 +159,21 @@
 		
 	} else
 		syslog(LOGLEVEL, buffer);
+
+	/* restore errno */
+	errno = s_errno;
 }
 
 static void canonicalize(const char *path, char *resolved_path) {
+
+    /* 2004/01/08 Benoit PAPILLAULT <benoit.papillault@free.fr>
+       Since this function can change errno, we save and restore it
+    */
+
+    int s_errno;
+
+    s_errno = errno;
+
 	if(!realpath(path, resolved_path) && (path[0] != '/')) {
 		/* The path could not be canonicalized, append it
 		 * to the current working directory if it was not 
@@ -167,6 +182,8 @@
 		strcat(resolved_path, "/");
 		strncat(resolved_path, path, MAXPATHLEN - 1);
 	}
+
+    errno = s_errno;
 } 
 
 static void make_path (char *path) {
@@ -532,7 +549,7 @@
 
 	backup (canonic);
 
-	result = true_chown(path, owner, group);
+	result = true_lchown(path, owner, group);
 	log("%d\tlchown\t%s\t%d\t%d\t#%s\n", result, canonic, owner, group, error(result));
 	return result;
 }
