Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文件系统返回后errno为负 #2002

Closed
heyuanjie87 opened this issue Nov 23, 2018 · 3 comments
Closed

文件系统返回后errno为负 #2002

heyuanjie87 opened this issue Nov 23, 2018 · 3 comments

Comments

@heyuanjie87
Copy link
Contributor

在移植linux代码的时候errno为正数,目前文件系统出错后errno为负数。
不确定以后rtt是否会向其他系统靠齐,我只好写成这样了:
if (fd < 0)
{
int eno = rt_get_errno();
if (eno == ENOENT || eno == -ENOENT)
{
if (!secure_mkdirs(path))
{
goto fail;
}
}
}

@BernardXiong
Copy link
Member

多找几个系统看看,这个修改影响很大呢

@BernardXiong
Copy link
Member

linux,freebsd,然后其他的,例如vxworks,rtems等

@mysterywolf
Copy link
Member

#4791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants