提交 3bd1a372 编写于 作者: W www220@tom.com

修正mkdir lseek中文件句柄不释放的bug

上级 0da4930c
...@@ -230,6 +230,7 @@ off_t lseek(int fd, off_t offset, int whence) ...@@ -230,6 +230,7 @@ off_t lseek(int fd, off_t offset, int whence)
break; break;
default: default:
fd_put(d);
rt_set_errno(-DFS_STATUS_EINVAL); rt_set_errno(-DFS_STATUS_EINVAL);
return -1; return -1;
...@@ -237,6 +238,7 @@ off_t lseek(int fd, off_t offset, int whence) ...@@ -237,6 +238,7 @@ off_t lseek(int fd, off_t offset, int whence)
if (offset < 0) if (offset < 0)
{ {
fd_put(d);
rt_set_errno(-DFS_STATUS_EINVAL); rt_set_errno(-DFS_STATUS_EINVAL);
return -1; return -1;
...@@ -457,6 +459,7 @@ int mkdir(const char *path, mode_t mode) ...@@ -457,6 +459,7 @@ int mkdir(const char *path, mode_t mode)
if (result < 0) if (result < 0)
{ {
fd_put(d);
fd_put(d); fd_put(d);
rt_set_errno(result); rt_set_errno(result);
...@@ -465,6 +468,7 @@ int mkdir(const char *path, mode_t mode) ...@@ -465,6 +468,7 @@ int mkdir(const char *path, mode_t mode)
dfs_file_close(d); dfs_file_close(d);
fd_put(d); fd_put(d);
fd_put(d);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册