]> git.ipfire.org Git - thirdparty/kmod.git/commit
depmod: add tmpfile-util to generate temporary file
authorWang, Wenjie2 <wenjie2.wang@intel.com>
Wed, 19 Mar 2025 01:54:08 +0000 (01:54 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 3 Apr 2025 04:23:28 +0000 (23:23 -0500)
commitaae48bc9f73a1bce726871027f73cbc0543c65d4
treeb62f4f53481d1e52bee66f2a3a020992d0ce16a9
parent9078a01c0e2e1ef64ba292c7b386e8c2ad077bd0
depmod: add tmpfile-util to generate temporary file

* we use `mkstemp` to create the temporary file since it's a general
  function in linux system and O_TMPFILE is not supported on all linux
  system.
* add `struct tmpfile` to keep the `dirfd`, temp file `fd` and the
  filename.

Co-developed-by: Wenjie Wang <wenjie2.wang@intel.com>
Signed-off-by: Wenjie Wang <wenjie2.wang@intel.com>
Co-developed-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Dan He <dan.h.he@intel.com>
Signed-off-by: Qingqing Li <qingqing.li@intel.com>
Signed-off-by: Yuchi Chen <yuchi.chen@intel.com>
Link: https://github.com/kmod-project/kmod/pull/305
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
meson.build
shared/tmpfile-util.c [new file with mode: 0644]
shared/tmpfile-util.h [new file with mode: 0644]
shared/util.c
shared/util.h
tools/depmod.c