mv() doesn't properly move files accross filesystems
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3073
Reported by Marek Habersack, The Caudium Group grendel@caudium.net
This is due to the fact that rename(2) uses hardlinks to rename the files and they don't work accross filesystems. The attached diff fixes it by using a file copy followed by an unlink in the situation when the destination is on a different filesystem than the source. The mv() semantics aren't changed, simply augmented that way.