diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c index e1c693ef041..511a043c363 100644 --- a/fs/hostfs/hostfs.c +++ b/fs/hostfs/hostfs.c @@ -296,7 +296,7 @@ static int hostfs_open(FAR struct file *filep, FAR const char *relpath, { /* Error opening file */ - ret = -EBADF; + ret = hf->fd; goto errout_with_buffer; }