mirror of
				git://git.code.sf.net/p/cdesktopenv/code
				synced 2025-03-09 15:50:02 +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)
 | 
					EraseObject(char *nameP, int force)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  struct stat src_stat;
 | 
					  struct stat src_stat;
 | 
				
			||||||
  int rc;
 | 
					  int rc = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (periodicCallback)
 | 
					  if (periodicCallback)
 | 
				
			||||||
    if (periodicCallback() != 0)
 | 
					    if (periodicCallback() != 0)
 | 
				
			||||||
| 
						 | 
					@ -396,15 +396,15 @@ EraseObject(char *nameP, int force)
 | 
				
			||||||
  if (lstat(nameP, &src_stat) < 0)
 | 
					  if (lstat(nameP, &src_stat) < 0)
 | 
				
			||||||
    rc = errno;
 | 
					    rc = errno;
 | 
				
			||||||
  else if ((src_stat.st_mode & S_IFMT) == S_IFDIR) {
 | 
					  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;
 | 
					      return errno;
 | 
				
			||||||
    rc = EmptyDir(nameP, 1, force);
 | 
					    rc = EmptyDir(nameP, 1, force);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else {
 | 
					  else {
 | 
				
			||||||
    if (! (force || access(nameP, W_OK)))
 | 
					    if (!force && access(nameP, W_OK))
 | 
				
			||||||
      return errno;
 | 
					      return errno;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (! unlink(nameP))
 | 
					    if (unlink(nameP))
 | 
				
			||||||
      rc = errno;
 | 
					      rc = errno;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue