- * side */
-
- buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR);
- if (buffer_fd < 0) {
- r = -errno;
- goto finish;
- }
-
- if (unlink(path) < 0) {
- close_nointr_nofail(buffer_fd);
- r = -errno;
- goto finish;
- }
+ * side.
+ *
+ * We use /dev/shm instead of /tmp here, since we want this to
+ * be a tmpfs, and one that is available from early boot on
+ * and where unprivileged users can create files. */
+ buffer_fd = open_tmpfile("/dev/shm", O_RDWR | O_CLOEXEC);
+ if (buffer_fd < 0)
+ return buffer_fd;