Skip to content
Snippets Groups Projects
Commit a0378fb9 authored by Al Viro's avatar Al Viro
Browse files

getcwd(2): saner logics around prepend_path() call


The only negative value that might get returned by prepend_path() is
-ENAMETOOLONG, and that happens only on overflow.  The same goes for
prepend_unreachable().  Overflow is detectable by observing negative
buflen, so we can simplify the control flow around the prepend_path()
call.  Expand prepend_unreachable(), while we are at it - that's the
only caller.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 9024348f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment