#include <config.h>
#include <config-kdeinit.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include "proctitle.h"
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <locale.h>
#include <QtCore/QLibrary>
#include <QtCore/QString>
#include <QtCore/QFile>
#include <QtCore/QDate>
#include <QtCore/QFileInfo>
#include <QtCore/QRegExp>
#include <QtGui/QFont>
#include <kcomponentdata.h>
#include <klibrary.h>
#include <kdemacros.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <kconfig.h>
#include <kapplication.h>
#include <klocale.h>
#include <kdebug.h>
#include <kde_file.h>
#include <ksavefile.h>
#include <sys/prctl.h>
#include <kdeversion.h>
#include "klauncher_cmds.h"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <fixx11h.h>
#include <kstartupinfo.h>
Go to the source code of this file.
|
static void | child_died (pid_t exit_pid, int exit_status) |
static void | cleanup_fds () |
static void | close_fds () |
static void | complete_startup_info (KStartupInfoId &id, pid_t pid) |
QByteArray | execpath_avoid_loops (const QByteArray &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 bool | handle_launcher_request (int sock, const char *who) |
static void | handle_requests (pid_t waitForPid) |
static void | init_kdeinit_socket () |
static void | init_signals () |
static void | init_startup_info (KStartupInfoId &id, const char *bin, int envc, const char *envs) |
static int | initXconnection () |
static void | kdeinit_library_path () |
int | kdeinit_x_errhandler (Display *, XErrorEvent *err) |
int | kdeinit_xio_errhandler (Display *) |
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 | setupX () |
static void | sig_child_handler (int) |
static void | start_klauncher () |
◆ DISPLAY
#define DISPLAY "DISPLAY" |
◆ MAX_SOCK_FILE
#define MAX_SOCK_FILE 255 |
◆ PR_SET_NAME
◆ QT_NO_CAST_FROM_ASCII
#define QT_NO_CAST_FROM_ASCII |
◆ child_died()
void child_died |
( |
pid_t | exit_pid, |
|
|
int | exit_status ) |
|
static |
◆ cleanup_fds()
◆ close_fds()
◆ complete_startup_info()
void complete_startup_info |
( |
KStartupInfoId & | id, |
|
|
pid_t | pid ) |
|
static |
◆ execpath_avoid_loops()
QByteArray execpath_avoid_loops |
( |
const QByteArray & | exec, |
|
|
int | envc, |
|
|
const char * | envs, |
|
|
bool | avoid_loops ) |
◆ exitWithErrorMsg()
void exitWithErrorMsg |
( |
const QString & | errorMsg | ) |
|
|
static |
◆ get_current_desktop()
int get_current_desktop |
( |
Display * | disp | ) |
|
|
static |
◆ get_env_var()
const char * get_env_var |
( |
const char * | var, |
|
|
int | envc, |
|
|
const char * | envs ) |
◆ handle_launcher_request()
bool handle_launcher_request |
( |
int | sock, |
|
|
const char * | who ) |
|
static |
◆ handle_requests()
void handle_requests |
( |
pid_t | waitForPid | ) |
|
|
static |
◆ init_kdeinit_socket()
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
Definition at line 871 of file kinit.cpp.
◆ init_signals()
◆ init_startup_info()
void init_startup_info |
( |
KStartupInfoId & | id, |
|
|
const char * | bin, |
|
|
int | envc, |
|
|
const char * | envs ) |
|
static |
◆ initXconnection()
◆ kdeinit_library_path()
void kdeinit_library_path |
( |
| ) |
|
|
static |
◆ kdeinit_x_errhandler()
int kdeinit_x_errhandler |
( |
Display * | dpy, |
|
|
XErrorEvent * | err ) |
◆ kdeinit_xio_errhandler()
int kdeinit_xio_errhandler |
( |
Display * | disp | ) |
|
Delete any stale socket file
Definition at line 1505 of file kinit.cpp.
◆ launch()
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 467 of file kinit.cpp.
◆ launcher_died()
◆ main()
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 1652 of file kinit.cpp.
◆ read_socket()
int read_socket |
( |
int | sock, |
|
|
char * | buffer, |
|
|
int | len ) |
|
static |
◆ reset_oom_protect()
void reset_oom_protect |
( |
| ) |
|
|
static |
◆ secondary_child_handler()
void secondary_child_handler |
( |
int | | ) |
|
|
static |
◆ setup_tty()
void setup_tty |
( |
const char * | tty | ) |
|
|
static |
◆ setupX()
◆ sig_child_handler()
void sig_child_handler |
( |
int | | ) |
|
|
static |
◆ start_klauncher()
◆ accepted_fd
◆ argv
◆ children
◆ [struct]
◆ deadpipe
◆ debug_wait
◆ environ
◆ errorMsg
◆ exit_status
◆ extra_libs
Initial value:= {
"libkio.so.5",
"libkparts.so.4",
}
Definition at line 91 of file kinit.cpp.
◆ fd
◆ fork
◆ func
int(* func) (int, char *[]) |
( |
int | , |
|
|
char * | [] ) |
◆ initpipe
◆ kded_pid
◆ launcher
◆ launcher_func
int(* launcher_func) (int) |
( |
int | | ) |
|
◆ launcher_ok
◆ launcher_pid
◆ maxname
◆ result
◆ s_instance
◆ sock_file
◆ suicide
◆ wrapper
◆ X11_startup_notify_display
Display* X11_startup_notify_display = 0 |
|
static |
◆ X11_startup_notify_fd
int X11_startup_notify_fd = -1 |
|
static |
◆ X11display
◆ X11fd
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by
doxygen 1.14.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.