1 Star 0 Fork 18

lihui/ltrace

forked from src-openEuler/ltrace 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ltrace-0.7.91-cant_open.patch 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
sigui 提交于 2020-02-21 02:22 . Package init
diff -urp ltrace-0.7.91/libltrace.c master/libltrace.c
--- ltrace-0.7.91/libltrace.c 2014-01-14 16:31:37.696174464 +0100
+++ master/libltrace.c 2013-11-21 14:06:38.623701688 +0100
@@ -113,9 +117,13 @@ ltrace_init(int argc, char **argv) {
if (command) {
/* Check that the binary ABI is supported before
* calling execute_program. */
- struct ltelf lte;
- ltelf_init(&lte, command);
- ltelf_destroy(&lte);
+ {
+ struct ltelf lte;
+ if (ltelf_init(&lte, command) == 0)
+ ltelf_destroy(&lte);
+ else
+ exit(EXIT_FAILURE);
+ }
pid_t pid = execute_program(command, argv);
struct process *proc = open_program(command, pid);
diff -urp ltrace-0.7.91/ltrace-elf.c master/ltrace-elf.c
--- ltrace-0.7.91/ltrace-elf.c 2014-01-14 16:31:37.688174420 +0100
+++ master/ltrace-elf.c 2013-11-22 18:17:11.767721609 +0100
@@ -361,8 +361,11 @@ ltelf_init(struct ltelf *lte, const char
{
memset(lte, 0, sizeof *lte);
lte->fd = open(filename, O_RDONLY);
- if (lte->fd == -1)
+ if (lte->fd == -1) {
+ fprintf(stderr, "Can't open %s: %s\n", filename,
+ strerror(errno));
return 1;
+ }
elf_version(EV_CURRENT);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Lh03061238/ltrace.git
git@gitee.com:Lh03061238/ltrace.git
Lh03061238
ltrace
ltrace
master

搜索帮助