summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--old/fileutils/ChangeLog3
-rw-r--r--src/touch.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/old/fileutils/ChangeLog b/old/fileutils/ChangeLog
index 0975a6708..893ab362d 100644
--- a/old/fileutils/ChangeLog
+++ b/old/fileutils/ChangeLog
@@ -2,6 +2,9 @@
* Version 4.1.1.
+ * src/touch.c (touch): Extend last change to work on systems
+ for which errno is set to EINVAL.
+
* src/ls.c: Declare some local variables to be `const', where
appropriate.
(usage): Improve the description of --dereference (-L).
diff --git a/src/touch.c b/src/touch.c
index 517ec8481..e3871c6e2 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -145,8 +145,9 @@ touch (const char *file)
/* Don't save a copy of errno if it's EISDIR, since that would lead
touch to give a bogus diagnostic for e.g., `touch /' (assuming
- we don't own / or have write access to it). */
- if (fd == -1 && errno != EISDIR)
+ we don't own / or have write access to it). On Solaris 5.6,
+ and probably other systems, it is EINVAL. */
+ if (fd == -1 && errno != EISDIR && errno != EINVAL)
open_errno = errno;
}