summaryrefslogtreecommitdiff
path: root/lib/creat.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-09-23 12:41:22 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-09-23 12:46:53 -0700
commit505e3dbfa8a784815ce0830ef891abb90bcce3dd (patch)
tree49c0f16526d8703b137de7c4bd9f3686d9dfc0d7 /lib/creat.c
parent9e78024bad107fe786cc3e5e328a475921ea0873 (diff)
downloadgnulib-505e3dbfa8a784815ce0830ef891abb90bcce3dd.tar.gz
Update URLs and associated text
(Thanks to Bruno Haible for proofreading the earlier patch.)
Diffstat (limited to 'lib/creat.c')
-rw-r--r--lib/creat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/creat.c b/lib/creat.c
index 89132e2bb2..e63b219576 100644
--- a/lib/creat.c
+++ b/lib/creat.c
@@ -44,8 +44,9 @@ int
creat (const char *filename, mode_t mode)
{
#if OPEN_TRAILING_SLASH_BUG
- /* If the filename ends in a slash, then fail.
- Rationale: POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html>
+ /* Fail if the filename ends in a slash,
+ as POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>.
creat() is defined as being equivalent to open() with flags
O_CREAT | O_TRUNC | O_WRONLY. Therefore:
If the named file already exists as a directory, then creat() must fail