fjpanag opened a new pull request #3498:
URL: https://github.com/apache/incubator-nuttx/pull/3498


   ## Summary
   Syslog_device has logic to open the device in a later time, in case 
initialization fails.  
   However, after this initial opening, no further checks were done. The state 
`SYSLOG_FAILURE` was not actually used anywhere.
   
   If the device was opened successfully, but there was a problem occurring at 
a later time, during actual logging, the driver was not able to detect this. 
There was no way to recover from this state, and the user couldn't know of the 
failure.  
   Eventually all subsequent logging is lost.
   
   The changes in this PR properly set the driver state in `SYSLOG_FAILURE` 
when any fault occurs.  
   At a later point, the device will be properly closed, and marked again as 
`SYSLOG_REOPEN`. So the initialization process can be executed again, and have 
the channel recover from the problem.
   
   *Note!* This change is not intended to handle logs on removable media. It 
should not be used to open and close the file as e.g. an SD card is inserted 
and removed. The proper (and much more efficient) way to do this, would be to 
call `syslog_channel()` and `syslog_channel_remove()` every time the medium is 
mounted/unmounted.  
   This is mostly intended as an error handling mechanism.
   
   ## Impact
   Syslog_device's can now recover from any problems during logging.
   
   ## Testing
   Incomplete, I will un-draft the PR when testing is complete.
   


-- 
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.

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


Reply via email to