mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 03:28:07 +00:00
Quit on ctrl+d
This commit is contained in:
parent
9993524ada
commit
2b27923fc8
1 changed files with 5 additions and 0 deletions
|
|
@ -706,6 +706,7 @@ char *Daemon::readLine(const char *prompt) {
|
|||
#ifdef HAVE_READLINE
|
||||
return readline(prompt);
|
||||
#else
|
||||
if (cin.eof()) return NULL;
|
||||
cout << prompt;
|
||||
char *buff = (char *) malloc(sLineSize);
|
||||
cin.getline(buff, sLineSize);
|
||||
|
|
@ -735,6 +736,10 @@ int Daemon::run() {
|
|||
if (mServerFd == -1 && ret != NULL) {
|
||||
free(ret);
|
||||
}
|
||||
if (!ret && mRunning) {
|
||||
mRunning = false; // ctrl+d
|
||||
cout << "Quitting..." << endl;
|
||||
}
|
||||
}
|
||||
stopThread();
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue