ending a ncurses proggy is not simple

This commit is contained in:
phyto 2019-07-30 21:18:50 +02:00
부모 ee5f22419a
커밋 4a033432bf
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제

파일 보기

@ -126,7 +126,7 @@ fclose(fp);
return 0;
}
/* --------------------------------------------------------------- */
static void finish(int signal)
static void finish(void)
{
endwin();
fprintf(stderr, "end of pid %d\n", getpid());
@ -180,16 +180,18 @@ sleep(1);
initscr();
nonl(); cbreak(); noecho();
keypad(stdscr, TRUE); /* acces aux touches 'curseur' */
atexit(finish);
sprintf(ligne, " Demonstrator pid:%d %s ", getpid(), device);
fond_ecran(ligne);
traite_les_messages(serial_in, nbreloops, K);
/*
* plop, on a fini, il faut restaurer la console
*/
finish(0);
finish();
return 0;
}