Subversion Repositories Kolibri OS

Rev

Rev 8632 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8632 Rev 8635
Line 1... Line 1...
1
#include 
1
#include 
2
#include 
2
#include 
3
#include 
3
#include 
4
#include "shell.h"
4
#include "shell.h"
-
 
5
#include 
Line 5... Line 6...
5
 
6
 
6
char __shell_shm_name[32]; 
7
char __shell_shm_name[32]; 
7
char*__shell_shm=NULL;
8
char*__shell_shm=NULL;
Line 23... Line 24...
23
    itoa(PID, __shell_shm_name);
24
    itoa(PID, __shell_shm_name);
24
    strcat(__shell_shm_name, "-SHELL");
25
    strcat(__shell_shm_name, "-SHELL");
25
    return _ksys_shm_open(__shell_shm_name,  KSYS_SHM_OPEN_ALWAYS | KSYS_SHM_WRITE, SHELL_SHM_MAX, &__shell_shm);
26
    return _ksys_shm_open(__shell_shm_name,  KSYS_SHM_OPEN_ALWAYS | KSYS_SHM_WRITE, SHELL_SHM_MAX, &__shell_shm);
26
}
27
}
Line 27... Line 28...
27
 
28
 
28
int __shell_init()
29
void __shell_init()
29
{
30
{
30
    if(__shell_is_init){
-
 
31
        return 0;
-
 
32
    }
31
    if(!__shell_is_init){
33
    if(__shell_shm_init()){
32
        if(__shell_shm_init()){
-
 
33
        debug_printf("SHELL problems detected!\n");
-
 
34
        _ksys_exit();
-
 
35
        }
-
 
36
 
-
 
37
        if(!shell_ping()){
34
        debug_printf("Shell problems detected!\n");
38
        debug_printf("No SHELL found!\n");
-
 
39
        _ksys_exit();
35
        return -1;
40
        }
36
    }
-
 
37
    return 0;
41
    }
38
}
42
}