[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] cp -df doesn't work as expect for links.
From:       "Joe.C" <joe () numa ! com ! tw>
Date:       2002-09-24 20:35:03
[Download RAW message or body]

It didn't work in 0.60.4. Try this

===========
touch aa
ln -s aa bb
cp -df bb cc
===========

    The file 'cc' should be a symbolic link to aa.
    I've attached my patch to fix this problem.

    Maybe we should create some testcase and test every time after
copy_file.c is changed to make sure all condition is correct?

Joe.C

["copy_file.patch" (text/plain)]

*** copy_file.c.org	Thu Sep 19 03:21:07 2002
--- copy_file.c	Wed Sep 25 10:25:27 2002
***************
*** 42,50 ****
  	int status = 0;
  
  	if ((!(flags & FILEUTILS_PRESERVE_SYMLINKS) &&
! 			lstat(source, &source_stat) < 0) ||
  			((flags & FILEUTILS_PRESERVE_SYMLINKS) &&
! 			 stat(source, &source_stat) < 0)) {
  		perror_msg("%s", source);
  		return -1;
  	}
--- 42,50 ----
  	int status = 0;
  
  	if ((!(flags & FILEUTILS_PRESERVE_SYMLINKS) &&
! 			stat(source, &source_stat) < 0) ||
  			((flags & FILEUTILS_PRESERVE_SYMLINKS) &&
! 			 lstat(source, &source_stat) < 0)) {
  		perror_msg("%s", source);
  		return -1;
  	}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic