+ // Spawn root application
+ if( rootapp )
+ {
+ int pid;
+ char *args[7+rootapp_argc+1];
+
+ args[0] = "ld-acess";
+ args[1] = "--open"; args[2] = "/Devices/VTerm/0";
+ args[3] = "--open"; args[4] = "/Devices/VTerm/0";
+ args[5] = "--open"; args[6] = "/Devices/VTerm/0";
+ for( i = 0; i < rootapp_argc; i ++ )
+ args[7+i] = rootapp[i];
+ args[7+rootapp_argc] = NULL;
+
+ pid = fork();
+ if(pid < 0) {
+ perror("Starting root application [fork(2)]");
+ return 1;
+ }
+ if(pid == 0)
+ {
+ #ifdef __LINUX__
+ prctl(PR_SET_PDEATHSIG, SIGHUP); // LINUX ONLY!
+ #endif
+ execv("./ld-acess", args);
+ }
+ printf("Root application running as PID %i\n", pid);
+ }
+
+ UI_MainLoop();
+