Add Qalculate package (#393)
[termux-packages] / packages / qalc / qalc.cc.patch
1 --- ../../build/qalc/cache/libqalculate-0.9.9/src/qalc.cc 2016-07-26 14:41:40.000000000 +0200
2 +++ ./src/qalc.cc 2016-08-15 00:22:57.905765966 +0200
3 @@ -295,7 +295,7 @@
4 save_defs();
5 }
6 }
7 - pthread_cancel(view_thread);
8 + pthread_kill(view_thread, 0);
9 CALCULATOR->terminateThreads();
10 }
11
12 @@ -1138,7 +1138,7 @@
13 if(!cfile) {
14 printf(_("Could not open \"%s\".\n"), command_file.c_str());
15 if(!interactive_mode) {
16 - pthread_cancel(view_thread);
17 + pthread_kill(view_thread, 0);
18 CALCULATOR->terminateThreads();
19 return 0;
20 }
21 @@ -1166,7 +1166,7 @@
22 execute_expression(interactive_mode);
23 }
24 if(!interactive_mode) {
25 - pthread_cancel(view_thread);
26 + pthread_kill(view_thread, 0);
27 CALCULATOR->terminateThreads();
28 return 0;
29 }
30 @@ -2619,7 +2619,7 @@
31 }
32
33 void on_abort_command() {
34 - pthread_cancel(command_thread);
35 + pthread_kill(command_thread, 0);
36 CALCULATOR->restoreState();
37 CALCULATOR->clearBuffers();
38 b_busy = false;
39 @@ -2629,8 +2629,8 @@
40
41 void *command_proc(void *pipe) {
42
43 - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
44 - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
45 + //pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
46 + //pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
47 FILE *command_pipe = (FILE*) pipe;
48
49 while(true) {