...
While this particular example benefits from calling exit()
over abort()
, there will be situations where abort()
is the better choice. Usually this will occur if one does not want to close any file descriptors or call any handlers registered with atexit()
, for instance, if the speed of terminating the program is critical.
Risk Analysis
An usage of Using abort()
or _Exit()
in place of exit()
may leave written files written in an inconsistent state. It , and may also leave sensitive temporary files on the filesystem.
...