File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 19301930\texttt {exit(-1) }. Based on the information in the previous paragraph,
19311931from \texttt {-1 } you will get \texttt {255 } as the return value you get in the
19321932shell in \texttt {\$ ? }. It just creates confusion.
1933+ Example: \example {main/return-negative-1.c}.
19331934\item It is very reasonable to use only \texttt {EXIT\_ SUCCESS } (\texttt {0 }) and
19341935\texttt {EXIT\_ FAILURE } (\texttt {1 }) unless there is a valid reason for other
19351936values. Sometimes you might need more values to distinguish between failures.
19361937For example, the \texttt {passwd } command on Solaris have quite a few of them, go
1937- check its manual page if interested, section \texttt {EXIT STATUS }. Example:
1938- \example {main/return-negative-1.c}.
1938+ check its manual page if interested, section \texttt {EXIT STATUS }.
19391939\item The difference between function \texttt {exit() } and \verb #_exit() # is that
19401940\texttt {exit } also flushes and closes streams (try it out with \texttt {printf() }
19411941\emsl {without} printing a new line), and calls functions registered via
You can’t perform that action at this time.
0 commit comments