From b4168cc60df215bf316567dd2952de27559f0d35 Mon Sep 17 00:00:00 2001 From: armink Date: Sun, 22 Oct 2017 22:14:55 +0800 Subject: [PATCH] [DFS] Fix `fd_new` failed return value. --- components/dfs/src/dfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index e5a8aa549d..c83aad3e2d 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -128,7 +128,7 @@ int fd_new(void) /* can't find an empty fd entry */ if (idx == DFS_FD_MAX) { - idx = -1; + idx = -(1 + DFS_FD_OFFSET); goto __result; }