projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
openat: fail with ENOENT on empty name
[gnulib.git]
/
lib
/
openat-proc.c
diff --git
a/lib/openat-proc.c
b/lib/openat-proc.c
index
8057033
..
76e1c6d
100644
(file)
--- a/
lib/openat-proc.c
+++ b/
lib/openat-proc.c
@@
-57,6
+57,13
@@
openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
{
static int proc_status = 0;
+ /* Make sure the caller gets ENOENT when appropriate. */
+ if (!*file)
+ {
+ buf[0] = '\0';
+ return buf;
+ }
+
if (! proc_status)
{
/* Set PROC_STATUS to a positive value if /proc/self/fd is