mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtcopy: Fix file removal
This commit is contained in:
parent
f6d6aafc93
commit
123d4ba8fc
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue