- c = namec(path, Aopen, vfs_flags, 0);
- if (waserror()) {
- cclose(c);
- nexterror();
+ if ((path[0] == '/') || (fromfd == AT_FDCWD)) {
+ c = namec(path, Aopen, vfs_flags, 0);
+ } else {
+ /* We don't cclose from. namec_from will convert it to the new chan
+ * during the walk process (c). It'll probably close from internally,
+ * and give us something new for c. On error, namec_from will cclose
+ * from. */
+ from = fdtochan(¤t->open_files, fromfd, -1, FALSE, TRUE);
+ c = namec_from(from, path, Aopen, vfs_flags, 0);