Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: src/xz/file_io.c

Issue 7109015: Update XZ Utils to 5.0.3 (in deps) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xz/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/xz/coder.c ('k') | src/xz/hardware.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/xz/file_io.c
===================================================================
--- src/xz/file_io.c (revision 50504)
+++ src/xz/file_io.c (working copy)
@@ -53,7 +53,7 @@
extern void
io_init(void)
{
- // Make sure that stdin, stdout, and and stderr are connected to
+ // Make sure that stdin, stdout, and stderr are connected to
// a valid file descriptor. Exit immediately with exit code ERROR
// if we cannot make the file descriptors valid. Maybe we should
// print an error message, but our stderr could be screwed anyway.
@@ -370,15 +370,16 @@
}
#ifdef O_NOFOLLOW
- // Give an understandable error message in if reason
+ // Give an understandable error message if the reason
// for failing was that the file was a symbolic link.
//
// Note that at least Linux, OpenBSD, Solaris, and Darwin
- // use ELOOP to indicate if O_NOFOLLOW was the reason
+ // use ELOOP to indicate that O_NOFOLLOW was the reason
// that open() failed. Because there may be
// directories in the pathname, ELOOP may occur also
// because of a symlink loop in the directory part.
- // So ELOOP doesn't tell us what actually went wrong.
+ // So ELOOP doesn't tell us what actually went wrong,
+ // and this stupidity went into POSIX-1.2008 too.
//
// FreeBSD associates EMLINK with O_NOFOLLOW and
// Tru64 uses ENOTSUP. We use these directly here
@@ -396,10 +397,10 @@
was_symlink = true;
# elif defined(__NetBSD__)
- // FIXME? As of 2008-11-20, NetBSD doesn't document what
- // errno is used with O_NOFOLLOW. It seems to be EFTYPE,
- // but since it isn't documented, it may be wrong to rely
- // on it here.
+ // As of 2010-09-05, NetBSD doesn't document what errno is
+ // used with O_NOFOLLOW. It is EFTYPE though, and I
+ // understood that is very unlikely to change even though
+ // it is undocumented.
if (errno == EFTYPE)
was_symlink = true;
@@ -456,15 +457,14 @@
goto error;
}
- if (reg_files_only) {
- if (!S_ISREG(pair->src_st.st_mode)) {
- message_warning(_("%s: Not a regular file, "
- "skipping"), pair->src_name);
- goto error;
- }
+ if (reg_files_only && !S_ISREG(pair->src_st.st_mode)) {
+ message_warning(_("%s: Not a regular file, skipping"),
+ pair->src_name);
+ goto error;
+ }
- // These are meaningless on Windows.
#ifndef TUKLIB_DOSLIKE
+ if (reg_files_only && !opt_force) {
if (pair->src_st.st_mode & (S_ISUID | S_ISGID)) {
// gzip rejects setuid and setgid files even
// when --force was used. bzip2 doesn't check
@@ -494,8 +494,8 @@
"skipping"), pair->src_name);
goto error;
}
+ }
#endif
- }
return false;
« no previous file with comments | « src/xz/coder.c ('k') | src/xz/hardware.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698