Hi - this fixes a bug that causes dtfile to leave copies of
moved/trashed files and directories when these are moved between
different filesystems.
From e09104c58ef4cc434ef3ae6de35fb16c532d9354 Mon Sep 17 00:00:00 2001
From: alx <a...@fastestcode.org>
Date: Thu, 25 Dec 2014 22:06:11 +0100
Subject: [PATCH] dtcopy: Fix file removal
Content-Length: 991
Status: RO
---
cde/programs/dtfile/dtcopy/fsrtns.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cde/programs/dtfile/dtcopy/fsrtns.c
b/cde/programs/dtfile/dtcopy/fsrtns.c
index c1d1d56..5532aca 100644
--- a/cde/programs/dtfile/dtcopy/fsrtns.c
+++ b/cde/programs/dtfile/dtcopy/fsrtns.c
@@ -387,7 +387,7 @@ static int
EraseObject(char *nameP, int force)
{
struct stat src_stat;
- int rc;
+ int rc = 0;
if (periodicCallback)
if (periodicCallback() != 0)
@@ -396,15 +396,15 @@ EraseObject(char *nameP, int force)
if (lstat(nameP, &src_stat) < 0)
rc = errno;
else if ((src_stat.st_mode & S_IFMT) == S_IFDIR) {
- if (! access(nameP, X_OK|W_OK))
+ if (access(nameP, X_OK|W_OK))
return errno;
rc = EmptyDir(nameP, 1, force);
}
else {
- if (! (force || access(nameP, W_OK)))
+ if (!force && access(nameP, W_OK))
return errno;
- if (! unlink(nameP))
+ if (unlink(nameP))
rc = errno;
}
--
2.2.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel