erofs-utils: lib: get rid of tmpfile()
authorGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 14 Feb 2025 06:24:06 +0000 (14:24 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Sat, 15 Feb 2025 01:00:57 +0000 (09:00 +0800)
commitb6b741d8daafc933ada19c3c5143357f87fb0e53
treeb658ce95281098534b834b4819f5d2ebb053794b
parent5e05ee09a3bc7331549d8e141dac0ccaf30feda5
erofs-utils: lib: get rid of tmpfile()

Currently, `tmpfile()` is problematic:

 - It uses `FILE *` instead of `fd`;
 - It may not leverage `$TMPDIR`, see `__gen_tempfd()`:
   https://sourceware.org/git?p=glibc.git;a=blob;f=stdio-common/tmpfile.c;hb=glibc-2.41

Switch to `erofs_tmpfile()` throughout the codebase.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250214062407.3281416-2-hsiangkao@linux.alibaba.com
configure.ac
include/erofs/fragments.h
include/erofs/io.h
lib/blobchunk.c
lib/fragments.c
lib/io.c
lib/liberofs_private.h
lib/xattr.c