diff --git a/system/cle/cle.c b/system/cle/cle.c index 31e01396c..9a0c0119c 100644 --- a/system/cle/cle.c +++ b/system/cle/cle.c @@ -1123,6 +1123,12 @@ int cle_fd(FAR char *line, FAR const char *prompt, uint16_t linelen, int cle(FAR char *line, FAR const char *prompt, uint16_t linelen, FAR FILE *instream, FAR FILE *outstream) { - return cle_fd(line, prompt, linelen, instream->fs_fd, outstream->fs_fd); + int instream_fd; + int outstream_fd; + + instream_fd = fileno(instream); + outstream_fd = fileno(outstream); + + return cle_fd(line, prompt, linelen, instream_fd, outstream_fd); } #endif diff --git a/system/readline/readline.c b/system/readline/readline.c index 8f263c2a0..cad9999e1 100644 --- a/system/readline/readline.c +++ b/system/readline/readline.c @@ -44,12 +44,18 @@ #ifdef CONFIG_FILE_STREAM ssize_t readline(FAR char *buf, int buflen, FILE *instream, FILE *outstream) { + int instream_fd; + int outstream_fd; + /* Sanity checks */ DEBUGASSERT(instream && outstream); /* Let readline_fd do the work */ - return readline_fd(buf, buflen, instream->fs_fd, outstream->fs_fd); + instream_fd = fileno(instream); + outstream_fd = fileno(outstream); + + return readline_fd(buf, buflen, instream_fd, outstream_fd); } #endif