Add cwd paramter to openp

This patch adds a cwd paramter to openp, so that the current directory
can be passed in by the caller.  This is useful when background
threads call this function -- they can then avoid using the global and
thus avoid races with the user using "cd".

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31716


2 files changed