mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 12:44:34 +03:00
Fail gracefully when /proc is not mounted
(thanks to Philipp Hagemeister)
This commit is contained in:
9
CRT.c
9
CRT.c
@ -11,8 +11,10 @@ in the source distribution for its full text.
|
||||
#include "String.h"
|
||||
|
||||
#include <curses.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_EXECINFO_H
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
@ -198,6 +200,13 @@ void CRT_done() {
|
||||
endwin();
|
||||
}
|
||||
|
||||
void CRT_fatalError(const char* note) {
|
||||
char* sysMsg = strerror(errno);
|
||||
CRT_done();
|
||||
fprintf(stderr, "%s: %s\n", note, sysMsg);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
int CRT_readKey() {
|
||||
nocbreak();
|
||||
cbreak();
|
||||
|
Reference in New Issue
Block a user