Re: [PATCH] doubt about fwrite

2019-12-23 Thread wei peng
Thanks for gregory and xiang. yes... the right way is modified the error handling code in nsh_catfile not fwrite. I will repaired it again. BR, wei peng Xiang Xiao 于2019年12月24日周二 上午9:58写道: > Hi Peng, > From http://www.cplusplus.com/reference/cstdio/fwrite/ > fwrite return zero to indicate the e

Re: [PATCH] doubt about fwrite

2019-12-23 Thread Xiang Xiao
Hi Peng, >From http://www.cplusplus.com/reference/cstdio/fwrite/ fwrite return zero to indicate the error, the detailed info could get from errno. So the right change is modified the error handling code in nsh_catfile, not the return type of fwrite. Thanks Xiang On Tue, Dec 24, 2019 at 9:48 AM we

Re: [PATCH] doubt about fwrite

2019-12-23 Thread Gregory Nutt
see the size_t is unsigned cannot be negative. that is the problem. i think if the terminal is close,the "size_t fwrite()"function should return a negative number,and the nsh_catfile should be broken. That is not the way that fwrite returns errors.  If an error occurs fwrite returns fewer ite

Re: [PATCH] doubt about fwrite

2019-12-23 Thread wei peng
hi David, Thanks for your reply. Yes...i know the interface interface is standard,so what i had changed in codes just repaired the problem.perhaps i should describe the problem in detail. I entering "dmesg" on both terminals,because of the “CONFIG_IOB_DEBUG” is enable so both of terminals will

Re: [PATCH] doubt about fwrite

2019-12-23 Thread David Sidrane
Hi wei peng See below. On 2019/12/23 07:41:40, wei peng wrote: > hi~ > I connected the target board to terminal via "telnet" , in some cases > the terminal will be frozen. Here are detailed steps: > >1. Enable "CONFIG_IOB_DEBUG"[necessary]. >2. New two terminals and connect to targe

[PATCH] doubt about fwrite

2019-12-22 Thread wei peng
hi~ I connected the target board to terminal via "telnet" , in some cases the terminal will be frozen. Here are detailed steps: 1. Enable "CONFIG_IOB_DEBUG"[necessary]. 2. New two terminals and connect to target board via "telnet". 3. Input "dmesg" command,and the terminal will show in

Fwd: [nuttx] [PATCH] doubt about fwrite

2019-12-22 Thread Gregory Nutt
Forwarded Message Subject:[nuttx] [PATCH] doubt about fwrite Date: Sun, 22 Dec 2019 18:30:04 -0800 (PST) From: wei peng Reply-To: nu...@googlegroups.com To: NuttX hi~   I connected the target board to terminal via "telnet" , in some cases th