summaryrefslogtreecommitdiff
path: root/lib/findprog.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-12-10 21:32:54 +0100
committerBruno Haible <bruno@clisp.org>2020-12-10 21:49:04 +0100
commit5fde00bdb689884f6de0ab2829f0df907380a010 (patch)
treeb021445b9a744808487a631e30d91bd9aa9b2076 /lib/findprog.h
parent658d3920dd6d1e41efe8d1f3b7e22a356e3d709d (diff)
downloadgnulib-5fde00bdb689884f6de0ab2829f0df907380a010.tar.gz
findprog-in: Don't exit upon out-of-memory.
* lib/findprog.h (find_in_given_path): Document ENOMEM as possible error code. * lib/findprog-in.c: Don't include xalloc.h. (find_in_given_path): Call concatenated_filename, not xconcatenated_filename. Call strdup, not xstrdup. Upon out-of-memory, return NULL with errno set. * modules/findprog-in (Depends-on): Remove xconcat-filename, xalloc. Add concat-filename, strdup-posix, malloc-posix.
Diffstat (limited to 'lib/findprog.h')
-rw-r--r--lib/findprog.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/findprog.h b/lib/findprog.h
index aef6289144..c020290d87 100644
--- a/lib/findprog.h
+++ b/lib/findprog.h
@@ -53,6 +53,7 @@ extern const char *find_in_path (const char *progname);
- EACCES: means that the program's file cannot be accessed (due to some
issue with one of the ancestor directories) or lacks the execute
permissions.
+ - ENOMEM: means out of memory.
If OPTIMIZE_FOR_EXEC is true, the function saves some work, under the
assumption that the resulting pathname will not be accessed directly,
only through execl/execv or execlp/execvp.