Skip to content

Commit d9e178a

Browse files
GUIDINGLIxiaoxiang781216
authored andcommitted
nshlib/console: fix compile error when open CONFIG_NSH_ALTCONDEV
CC: mm_heap/mm_memalign.c misc/rwbuffer.c: In function 'rwb_readbytes': misc/rwbuffer.c:1172:2: warning: #warning Not Implemented [-Wcpp] 1172 | #warning Not Implemented | ^~~~~~~ CC: binfmt_unloadmodule.c In file included from nsh_console.c:40: nsh_console.c: In function 'nsh_consoleredirect': nsh_console.h:85:30: error: 'struct serialsave_s' has no member named 'cn_confd'; did you mean 'cn_infd'? 85 | # define INFD(p) ((p)->cn_confd) | ^~~~~~~~ nsh_console.c:344:7: note: in expansion of macro 'INFD' 344 | INFD(ssave) = INFD(pstate); | ^~~~ nsh_console.c: In function 'nsh_consoleundirect': nsh_console.h:85:30: error: 'struct serialsave_s' has no member named 'cn_confd'; did you mean 'cn_infd'? 85 | # define INFD(p) ((p)->cn_confd) | ^~~~~~~~ nsh_console.c:370:18: note: in expansion of macro 'INFD' 370 | INFD(pstate) = INFD(ssave); | ^~~~ Signed-off-by: ligd <liguiding1@xiaomi.com>
1 parent 95368de commit d9e178a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nshlib/nsh_console.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@
4545

4646
struct serialsave_s
4747
{
48+
#ifdef CONFIG_NSH_ALTCONDEV
49+
int cn_confd; /* Console I/O file descriptor */
50+
#else
51+
int cn_infd; /* Re-directed input file descriptor */
52+
#endif
4853
int cn_errfd; /* Re-directed error output file descriptor */
4954
int cn_outfd; /* Re-directed output file descriptor */
50-
int cn_infd; /* Re-directed input file descriptor */
5155
};
5256

5357
/****************************************************************************

0 commit comments

Comments
 (0)