On 13/12/2022 12:46 am, Sergey Bugaev wrote:
@@ -90,6 +95,21 @@ __file_name_lookup_at (int fd, int at_flags,
          }
      }
+ if ((orig_flags & __O_TMPFILE) == __O_TMPFILE)
+    {
+      /* What we have looked up is not the file iteself, but actually

s/iteself/itself.\/

+         the directory to create the file in.  Do that now.  */
+      file_t dir = result;
+
+      err = __dir_mkfile (dir, orig_flags & ~O_TMPFILE, mode, &result);
+      __mach_port_deallocate (__mach_task_self (), dir);
+      if (err)
+        {
+          __hurd_fail (err);
+          return MACH_PORT_NULL;
+        }
+    }
+
    return result;
  }

HTH
Amos

Reply via email to