问题描述
在Linux中编译libxml的源码时,报错如下:
In function 'open',
inlined from 'xmlNanoHTTPSave' at nanohttp.c:1185:12:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
__open_missing_mode ();
解决方法
解决方法是,修该nanohttp.c文件1185行,如下:
- fd = open(stat_path, O_CREAT | O_WRONLY | O_TRUNC);
+ fd = open(stat_path, O_CREAT | O_WRONLY | O_TRUNC, 0600);
修改之后,再次make就正常了。
评论区