When we move the exit() out of venprintf(), we can reuse it for
weprintf(), which basically had duplicate code.
I also renamed venprintf() to xvprintf (extended vprintf) so it's
more obvious what it actually does.
by re-ordering when chmod/chown is done, only a list of directories (not
all files) need be kept for fixing mtime.
this also fixes an issue where set-user-id files in a tar may not work. chmod
is done before chown and before the file is written. if ownership changes, or
the file is being written as a normal user, the setuid bit would be cleared.
also fixes ownership of symbolic links. previously a chown() was called,
which would change the ownership of the link target. lchown() is now
used for symbolic links.
renamed all ent, ent* functions to dir* as it better describes what they
use timespec/utimensat instead of timeval/utimes to get AT_SYMLINK_NOFOLLOW
This can happen if you move a file from one filesystem to another.
rename(2) will fail and we will fall through to a manual cp + rm.
Initiate the rm through recurse() like we do for rm(1).
Thanks to Heiko for reporting this.
Copying shall begin at the point in the file indicated by the -c
number or -n number options.
The origin for counting shall be 1; that is, -c +1 represents the
first byte of the file, -c -1 the last.
The origin for counting shall be 1; that is, -n +1 represents the
first line of the file, -n -1 the last.
ls was using (old) UNIX spec (struct stat).st_[acm]time.
It now uses POSIX (struct stat).(struct timespec st_[acm]tim) which
gives time resolution in seconds and nanoseconds.
If two files have the same time in seconds, we extend the comparision to