kinit.cpp File Reference
#include "config.h"
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <setproctitle.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <locale.h>
#include <qstring.h>
#include <qfile.h>
#include <qdatetime.h>
#include <qfileinfo.h>
#include <qtextstream.h>
#include <qregexp.h>
#include <qfont.h>
#include <kinstance.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <kconfig.h>
#include <klibloader.h>
#include <kapplication.h>
#include <klocale.h>
#include <kdeversion.h>
#include "ltdl.h"
#include "klauncher_cmds.h"
#include <kparts/plugin.h>
#include <kio/authinfo.h>
Go to the source code of this file.
|
Defines |
#define | LTDL_GLOBAL 0 |
#define | MAX_SOCK_FILE 255 |
Functions |
KParts::Plugin * | _kinit_init_kparts () |
KIO::AuthInfo * | _kioslave_init_kio () |
static void | close_fds () |
QCString | execpath_avoid_loops (const QCString &exec, int envc, const char *envs, bool avoid_loops) |
static void | exitWithErrorMsg (const QString &errorMsg) |
static int | get_current_desktop (Display *disp) |
const char * | get_env_var (const char *var, int envc, const char *envs) |
static void | handle_launcher_request (int sock=-1) |
static void | handle_requests (pid_t waitForPid) |
static void | init_kdeinit_socket () |
static void | init_signals () |
static void | kdeinit_library_path () |
int | kdeinit_xio_errhandler (Display *disp) |
static pid_t | launch (int argc, const char *_name, const char *args, const char *cwd=0, int envc=0, const char *envs=0, bool reset_env=false, const char *tty=0, bool avoid_loops=false, const char *startup_id_str="0") |
static void | launcher_died () |
int | main (int argc, char **argv, char **envp) |
static int | read_socket (int sock, char *buffer, int len) |
static void | reset_oom_protect () |
static void | secondary_child_handler (int) |
static void | setup_tty (const char *tty) |
static void | sig_child_handler (int) |
static void | WaitPid (pid_t waitForPid) |
Variables |
struct { |
char ** argv |
int deadpipe [2] |
bool debug_wait |
QCString errorMsg |
int exit_status |
int fd [2] |
pid_t fork |
int(* func )(int, char *[]) |
lt_dlhandle handle |
int initpipe [2] |
int launcher [2] |
int(* launcher_func )(int) |
bool launcher_ok |
pid_t launcher_pid |
int lt_dlopen_flag |
int maxname |
pid_t my_pid |
int n |
char result |
bool suicide |
lt_ptr sym |
int wrapper |
int wrapper_old |
} | d |
char ** | environ |
int | lt_dlopen_flag |
static const KInstance * | s_instance = 0 |
static char | sock_file [MAX_SOCK_FILE] |
static char | sock_file_old [MAX_SOCK_FILE] |
Define Documentation
#define MAX_SOCK_FILE 255 |
Function Documentation
KParts::Plugin* _kinit_init_kparts |
( |
|
) |
|
KIO::AuthInfo* _kioslave_init_kio |
( |
|
) |
|
static void close_fds |
( |
|
) |
[static] |
QCString execpath_avoid_loops |
( |
const QCString & |
exec, |
|
|
int |
envc, |
|
|
const char * |
envs, |
|
|
bool |
avoid_loops | |
|
) |
| | |
static void exitWithErrorMsg |
( |
const QString & |
errorMsg |
) |
[static] |
static int get_current_desktop |
( |
Display * |
disp |
) |
[static] |
const char* get_env_var |
( |
const char * |
var, |
|
|
int |
envc, |
|
|
const char * |
envs | |
|
) |
| | |
static void handle_launcher_request |
( |
int |
sock = -1 |
) |
[static] |
static void handle_requests |
( |
pid_t |
waitForPid |
) |
[static] |
static void init_kdeinit_socket |
( |
|
) |
[static] |
Test if socket file is already present note that access() resolves symlinks, and so we check the actual socket file if it exists
Delete any stale socket file (and symlink)
create socket
bind it
set permissions
create compatibility socket
bind it
set permissions
Definition at line 824 of file kinit.cpp.
static void init_signals |
( |
|
) |
[static] |
static void kdeinit_library_path |
( |
|
) |
[static] |
int kdeinit_xio_errhandler |
( |
Display * |
disp |
) |
|
Delete any stale socket file
Delete any stale socket file
Definition at line 1543 of file kinit.cpp.
static pid_t launch |
( |
int |
argc, |
|
|
const char * |
_name, |
|
|
const char * |
args, |
|
|
const char * |
cwd = 0 , |
|
|
int |
envc = 0 , |
|
|
const char * |
envs = 0 , |
|
|
bool |
reset_env = false , |
|
|
const char * |
tty = 0 , |
|
|
bool |
avoid_loops = false , |
|
|
const char * |
startup_id_str = "0" | |
|
) |
| | [static] |
Child
Give the process a new name
Parent
Definition at line 421 of file kinit.cpp.
static void launcher_died |
( |
|
) |
[static] |
int main |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
char ** |
envp | |
|
) |
| | |
Save arguments first...
Make process group leader (for shutting down children later)
Create our instance
Prepare to change process name
Free arguments
Definition at line 1683 of file kinit.cpp.
static int read_socket |
( |
int |
sock, |
|
|
char * |
buffer, |
|
|
int |
len | |
|
) |
| | [static] |
static void reset_oom_protect |
( |
|
) |
[static] |
static void secondary_child_handler |
( |
int |
|
) |
[static] |
static void setup_tty |
( |
const char * |
tty |
) |
[static] |
static void sig_child_handler |
( |
int |
|
) |
[static] |
static void WaitPid |
( |
pid_t |
waitForPid |
) |
[static] |
Variable Documentation
struct { ... } d [static] |
int(* func)(int, char *[]) |