And remove useless ENOENT check: if open() fails with ENOENT, then mkstemp()
will fail with the same error.
From man open(2):
EOPNOTSUPP: The filesystem containing pathname does not support O_TMPFILE.
From man (2) open:
O_TMPFILE requires support by the underlying filesystem; only a subset of
Linux filesystems provide that support. In the initial implementation, support
was provided in the ext2, ext3, ext4, UDF, Minix, and shmem filesystems.
Support for other filesystems has subsequently been added as follows: XFS
(Linux 3.15); Btrfs (Linux 3.16); F2FS (Linux 3.16); and ubifs (Linux 4.9)
One must check for two different error codes, EISDIR and ENOENT, when trying to
determine whether the kernel supports O_TMPFILE functionality.
Fixes#22250