Skip to content
Snippets Groups Projects
  • Al Viro's avatar
    a0378fb9
    getcwd(2): saner logics around prepend_path() call · a0378fb9
    Al Viro authored
    
    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>
    a0378fb9
    History
    getcwd(2): saner logics around prepend_path() call
    Al Viro authored
    
    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>