diff --git a/fs/hostfs/hostfs.c b/fs/hostfs/hostfs.c index e1c693ef04..511a043c36 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; }