comparison terminal.c @ 2681:c4256ce2c45a

Updated Android port using gradle toolchain and with basic Storage Access Framework support for Android 11+ support
author Michael Pavone <pavone@retrodev.com>
date Wed, 26 Mar 2025 01:20:55 -0700
parents 794ba17f0716
children
comparison
equal deleted inserted replaced
2680:e3394457427e 2681:c4256ce2c45a
24 init_done = 1; 24 init_done = 1;
25 } 25 }
26 26
27 void init_terminal() 27 void init_terminal()
28 { 28 {
29 #ifndef IS_LIB 29 #if !defined(IS_LIB) && !defined(__ANDROID__)
30 if (!init_done) { 30 if (!init_done) {
31 if (!(isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))) { 31 if (!(isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))) {
32 #ifndef __APPLE__ 32 #ifndef __APPLE__
33 //check to see if x-terminal-emulator exists, just use xterm if it doesn't 33 //check to see if x-terminal-emulator exists, just use xterm if it doesn't
34 char *term = system("which x-terminal-emulator > /dev/null") ? "xterm" : "x-terminal-emulator"; 34 char *term = system("which x-terminal-emulator > /dev/null") ? "xterm" : "x-terminal-emulator";
38 unlink(OUTPUT_PATH); 38 unlink(OUTPUT_PATH);
39 //create FIFOs for talking to helper process in terminal app 39 //create FIFOs for talking to helper process in terminal app
40 mkfifo(INPUT_PATH, 0666); 40 mkfifo(INPUT_PATH, 0666);
41 mkfifo(OUTPUT_PATH, 0666); 41 mkfifo(OUTPUT_PATH, 0666);
42 42
43 //close existing file descriptors 43 //close existing file descriptorsbundled_file_path
44 close(STDIN_FILENO); 44 close(STDIN_FILENO);
45 close(STDOUT_FILENO); 45 close(STDOUT_FILENO);
46 close(STDERR_FILENO); 46 close(STDERR_FILENO);
47 47
48 child = fork(); 48 child = fork();