Date: Sat, 1 Apr 2017 10:54:14 -0500 From: Lewis Donzis <lew@perftech.com> To: freebsd-bugs@FreeBSD.org Subject: Fix cp not to give chflags error on NFS Message-ID: <8FDBAA2C-93B8-49FA-B3CD-5B709A93A5C4@perftech.com>
next in thread | raw e-mail | index | archive | help
It's fairly annoying that cp has no way to suppress the chflags error when the destination file is on an NFS mount. A bigger problem than the error message is that it returns exit status 1, which causes things like make to fail when there really was no error.
What do you think about the following change to /usr/src/bin/cp/utils.c:
398c398
< if (fdval ?
---
> if ((fdval ?
401c401
< chflags(to.p_path, fs->st_flags))) {
---
> chflags(to.p_path, fs->st_flags))) && errno != ENOTSUP) {
which simply ignores the error if the destination filesystem doesn't support chflags?
Thanks,
lew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8FDBAA2C-93B8-49FA-B3CD-5B709A93A5C4>
