雷达智富

首页 > 内容 > 程序笔记 > 正文

程序笔记

Linux下编译libxml源码时,报错:/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to '__open...

2024-08-12 26

问题描述

在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就正常了。

更新于:1个月前
赞一波!1

文章评论

全部评论