提交 9c21f434 编写于 作者: R Rich Felker

make popen cancellation-safe

close was the only cancellation point called from popen, but it left
popen with major resource leaks if any call to close got cancelled.
the easiest, cheapest fix is just to use a non-cancellable close
function.
上级 f305467a
#include "stdio_impl.h"
#include "syscall.h"
static inline void nc_close(int fd)
{
__syscall(SYS_close, fd);
}
#define close(x) nc_close(x)
FILE *popen(const char *cmd, const char *mode)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册