Deleted Added
full compact
mv.c (63225) mv.c (63680)
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[] =
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 63225 2000-07-15 14:59:02Z sada $";
48 "$FreeBSD: head/bin/mv/mv.c 63680 2000-07-20 18:30:00Z sada $";
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

--- 228 unchanged lines hidden (view full) ---

285 warnx(
286"%s: owner/group changed; clearing suid/sgid (mode was 0%03o)",
287 to, oldmode);
288 sbp->st_mode &= ~(S_ISUID | S_ISGID);
289 }
290 }
291 if (fchmod(to_fd, sbp->st_mode))
292 warn("%s: set mode (was: 0%03o)", to, oldmode);
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

--- 228 unchanged lines hidden (view full) ---

285 warnx(
286"%s: owner/group changed; clearing suid/sgid (mode was 0%03o)",
287 to, oldmode);
288 sbp->st_mode &= ~(S_ISUID | S_ISGID);
289 }
290 }
291 if (fchmod(to_fd, sbp->st_mode))
292 warn("%s: set mode (was: 0%03o)", to, oldmode);
293 /*
294 * XXX
295 * NFS doesn't support chflags; ignore errors unless there's reason
296 * to believe we're losing bits. (Note, this still won't be right
297 * if the server supports flags and we were trying to *remove* flags
298 * on a file that we copied, i.e., that we didn't create.)
299 */
300 errno = 0;
293 if (fchflags(to_fd, sbp->st_flags))
301 if (fchflags(to_fd, sbp->st_flags))
294 warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
302 if (errno != EOPNOTSUPP || sbp->st_flags != 0)
303 warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
295
296 tval[0].tv_sec = sbp->st_atime;
297 tval[1].tv_sec = sbp->st_mtime;
298 tval[0].tv_usec = tval[1].tv_usec = 0;
299 if (utimes(to, tval))
300 warn("%s: set times", to);
301
302 if (close(to_fd)) {

--- 67 unchanged lines hidden ---
304
305 tval[0].tv_sec = sbp->st_atime;
306 tval[1].tv_sec = sbp->st_mtime;
307 tval[0].tv_usec = tval[1].tv_usec = 0;
308 if (utimes(to, tval))
309 warn("%s: set times", to);
310
311 if (close(to_fd)) {

--- 67 unchanged lines hidden ---