summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-06-27 02:44:38 +0200
committerBruno Haible <bruno@clisp.org>2020-06-27 02:45:06 +0200
commit999b19465ad40e0aebbd126c63644acb9b2eddda (patch)
treead69a58988df0dbb1a904b656db80f8ca2bd17e6 /lib
parentc7f8c44d9cd5fda98c41a85dc248a4e3d66ea593 (diff)
downloadgnulib-999b19465ad40e0aebbd126c63644acb9b2eddda.tar.gz
fchdir: Improve documentation.
* lib/fchdir.c (get_name, _gl_register_fd): Document the failure return convention.
Diffstat (limited to 'lib')
-rw-r--r--lib/fchdir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/fchdir.c b/lib/fchdir.c
index 20ecd3c17b..1fa9a7edc6 100644
--- a/lib/fchdir.c
+++ b/lib/fchdir.c
@@ -84,7 +84,8 @@ ensure_dirs_slot (size_t fd)
return true;
}
-/* Return an absolute name of DIR in malloc'd storage. */
+/* Return an absolute name of DIR in malloc'd storage.
+ Upon failure, return NULL with errno set. */
static char *
get_name (char const *dir)
{
@@ -125,8 +126,8 @@ _gl_unregister_fd (int fd)
/* Mark FD as visiting FILENAME. FD must be non-negative, and refer
to an open file descriptor. If REPLACE_OPEN_DIRECTORY is non-zero,
this should only be called if FD is visiting a directory. Close FD
- and return -1 if there is insufficient memory to track the
- directory name; otherwise return FD. */
+ and return -1 with errno set if there is insufficient memory to track
+ the directory name; otherwise return FD. */
int
_gl_register_fd (int fd, const char *filename)
{