2014-06-08 13:33:59 -07:00
|
|
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
|
|
* This file is part of ToaruOS and is released under the terms
|
2014-06-07 23:13:29 -07:00
|
|
|
* of the NCSA / University of Illinois License - see LICENSE.md
|
|
|
|
* Copyright (C) 2013-2014 Kevin Lange
|
2014-06-08 13:33:59 -07:00
|
|
|
*
|
|
|
|
* Graphical Session Manager
|
|
|
|
*
|
2014-06-07 23:13:29 -07:00
|
|
|
*/
|
2012-09-12 22:10:10 -07:00
|
|
|
#include <stdlib.h>
|
2012-09-13 00:09:17 -07:00
|
|
|
#include <stdio.h>
|
2012-09-12 22:10:10 -07:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <syscall.h>
|
2013-05-05 15:00:24 -07:00
|
|
|
#include <signal.h>
|
2014-04-29 00:28:41 -07:00
|
|
|
#include <errno.h>
|
2014-04-27 01:37:33 -07:00
|
|
|
#include <sys/wait.h>
|
2012-09-12 22:10:10 -07:00
|
|
|
|
|
|
|
int main(int argc, char * argv[]) {
|
|
|
|
/* Starts a graphical session and then spins waiting for a kill (logout) signal */
|
|
|
|
|
2012-09-13 00:09:17 -07:00
|
|
|
int _wallpaper_pid = fork();
|
|
|
|
if (!_wallpaper_pid) {
|
2012-09-12 22:10:10 -07:00
|
|
|
char * args[] = {"/bin/wallpaper", NULL};
|
2012-10-08 00:17:50 -07:00
|
|
|
execvp(args[0], args);
|
2012-09-12 22:10:10 -07:00
|
|
|
}
|
2012-09-13 00:09:17 -07:00
|
|
|
int _panel_pid = fork();
|
|
|
|
if (!_panel_pid) {
|
2012-09-12 22:10:10 -07:00
|
|
|
char * args[] = {"/bin/panel", NULL};
|
2012-10-08 00:17:50 -07:00
|
|
|
execvp(args[0], args);
|
2012-09-12 22:10:10 -07:00
|
|
|
}
|
2014-04-21 19:46:38 -07:00
|
|
|
int _toastd_pid = fork();
|
|
|
|
if (!_toastd_pid) {
|
|
|
|
char * args[] = {"/bin/toastd", NULL};
|
|
|
|
execvp(args[0], args);
|
|
|
|
}
|
2012-09-12 22:10:10 -07:00
|
|
|
|
2014-04-27 01:37:33 -07:00
|
|
|
wait(NULL);
|
2012-09-12 22:10:10 -07:00
|
|
|
|
2014-04-29 00:28:41 -07:00
|
|
|
int pid;
|
|
|
|
do {
|
|
|
|
pid = waitpid(-1, NULL, 0);
|
|
|
|
} while ((pid > 0) || (pid == -1 && errno == EINTR));
|
2012-09-12 22:10:10 -07:00
|
|
|
|
2014-04-27 01:37:33 -07:00
|
|
|
return 0;
|
2012-09-12 22:10:10 -07:00
|
|
|
}
|