mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-31 22:40:27 +08:00
fix sys_getcwd (#8852)
This commit is contained in:
parent
be97a8ef25
commit
75f41723cb
@ -4718,9 +4718,10 @@ __exit:
|
||||
}
|
||||
#endif
|
||||
|
||||
char *sys_getcwd(char *buf, size_t size)
|
||||
long sys_getcwd(char *buf, size_t size)
|
||||
{
|
||||
char *tmp, *ret = RT_NULL;
|
||||
char *tmp = RT_NULL;
|
||||
long ret = -1;
|
||||
|
||||
if (!lwp_user_accessable((void *)buf, size))
|
||||
{
|
||||
@ -4737,7 +4738,10 @@ char *sys_getcwd(char *buf, size_t size)
|
||||
{
|
||||
if (lwp_put_to_user(buf, tmp, size) > 0)
|
||||
{
|
||||
ret = buf;
|
||||
if (buf != RT_NULL)
|
||||
ret = strlen(buf);
|
||||
else
|
||||
ret = -EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user