1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Ken Smith of The State University of New York at Buffalo. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 31 unchanged lines hidden (view full) --- 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /* not lint */ 42 43#ifndef lint 44#if 0 45static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; 46#endif 47static const char rcsid[] = |
48 "$FreeBSD: head/bin/mv/mv.c 62963 2000-07-11 18:01:42Z dwmalone $"; |
49#endif /* not lint */ 50 51#include <sys/param.h> 52#include <sys/time.h> 53#include <sys/wait.h> 54#include <sys/stat.h> 55#include <sys/mount.h> 56 --- 159 unchanged lines hidden (view full) --- 216 return (1); 217 } 218 219 /* 220 * If rename fails because we're trying to cross devices, and 221 * it's a regular file, do the copy internally; otherwise, use 222 * cp and rm. 223 */ |
224 if (lstat(from, &sb)) { |
225 warn("%s", from); 226 return (1); 227 } 228 return (S_ISREG(sb.st_mode) ? 229 fastcopy(from, to, &sb) : copy(from, to)); 230} 231 232int --- 135 unchanged lines hidden --- |