normanr opened a new pull request, #1214:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1214

   ## Summary
   Add an option to read the hostname from a file (eg: in `/etc/init.d/rcS`). 
Add a check that the hostname is non-empty.
   
   ## Impact
   Makes it possible to set hostname from a file without `NSH_CMDPARMS` enabled 
(eg: "hostname \`cat /etc/hostname\`"). Ensures that hostname must be non-blank.
   
   ## Testing
   ```
   nsh> hostname -F /data/hostname
   nsh> hostname -F /tmp/missing
   ERROR: Failed to open '/tmp/missing': No such file or directory
   nsh> hostname ""
   ERROR: The specified hostname is invalid
   nsh> echo > /tmp/newline
   nsh> hostname -F /tmp/newline
   ERROR: The specified hostname is invalid
   nsh> echo -n > /tmp/empty
   nsh> hostname -F /tmp/empty
   ERROR: The specified hostname is invalid
   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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to