JianyuWang0623 opened a new pull request, #16598:
URL: https://github.com/apache/nuttx/pull/16598

   ## Summary
   Fix output format of fd info.  Refered to PRINTF(3), the [v]snprintf returns 
the number of characters printed (excluding the null byte used to end output to 
strings).
   > Upon successful return, these functions return the number of characters 
printed (excluding the null byte used to end output to strings).    -- PRINTF(3)
   
   ## Impact
   - fs/procfs
   
   ## Testing
   - Currently
   1. Extra blank at line start, e.g. fd num 1 and below
   2. Truncated print, see fd num 3, missing end bracked "]"
   ```
   nsh> fdinfo 9
   
   FD  OFLAGS  TYPE POS       PATH           
   0   3       1    0         /dev/console 
    1   3       1    0         /dev/console 
    2   3       1    0         /dev/console 
    3   3       9    0         tcp:[0.0.0.0:5554<->0.0.0.0:0, st 01, flg 31
    4   1089    1    0         /dev/fastboot/ep
    5   1090    1    0         /dev/fastboot/ep
    6   0       1    0                      
    nsh> 
   nsh>
   ```
   - With this patch
   ```
   nsh> fdinfo 9
   
   FD  OFLAGS  TYPE POS       PATH           BACKTRACE
   0   3       1    0         /dev/console  
   1   3       1    0         /dev/console  
   2   3       1    0         /dev/console  
   3   3       9    0         tcp:[0.0.0.0:5554<->0.0.0.0:0, st 01, flg 31]
   4   1089    1    0         /dev/fastboot/ep2
   5   1090    1    0         /dev/fastboot/ep1
   6   0       1    0                       
   nsh>
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to