bool inh;
bool got_one = false;
- if (sscanf (get_name (), "/proc/self/fd/pipe:[%llu]",
- (long long *) &uniq_id) == 1)
- pid = myself->pid;
- else if (sscanf (get_name (), "/proc/%d/fd/pipe:[%llu]",
- &pid, (long long *) &uniq_id) < 2)
+ if (sscanf (get_name (), "/proc/%d/fd/pipe:[%llu]",
+ &pid, (long long *) &uniq_id) < 2)
{
set_errno (ENOENT);
return 0;
#include "pinfo.h"
#include "dtable.h"
#include "cygheap.h"
+#include "tls_pbuf.h"
fhandler_base *
fhandler_process_fd::fetch_fh (HANDLE &out_hdl, uint32_t flags)
CloseHandle (hdl);
return NULL;
}
+ /* relative path? This happens for special types like pipes and sockets. */
+ if (*pc.get_posix () != '/')
+ {
+ tmp_pathbuf tp;
+ char *fullpath = tp.c_get ();
+
+ stpcpy (stpncpy (fullpath, get_name (), path - get_name ()),
+ pc.get_posix ());
+ pc.set_posix (fullpath);
+ }
fhandler_base *fh = build_fh_pc (pc);
if (!fh)
{
{
cygheap_fdnew fdin;
cygheap_fdnew fdout (fdin, false);
- char buf[sizeof ("/proc/self/fd/pipe:[9223372036854775807]")];
- __small_sprintf (buf, "/proc/self/fd/pipe:[%D]", fhs[0]->get_plain_ino ());
+ char buf[sizeof ("pipe:[9223372036854775807]")];
+ __small_sprintf (buf, "pipe:[%D]", fhs[0]->get_plain_ino ());
fhs[0]->pc.set_posix (buf);
__small_sprintf (buf, "pipe:[%D]", fhs[1]->get_plain_ino ());
fhs[1]->pc.set_posix (buf);