mirror of
https://github.com/fluencelabs/musl
synced 2025-06-19 18:01:43 +00:00
make tmpfile slightly more efficient (use unlink syscall instead of remove)
This commit is contained in:
@ -17,7 +17,7 @@ FILE *tmpfile(void)
|
|||||||
fd = syscall(SYS_open, s, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600);
|
fd = syscall(SYS_open, s, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600);
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
f = __fdopen(fd, "w+");
|
f = __fdopen(fd, "w+");
|
||||||
remove(s);
|
syscall(SYS_unlink, s);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user