diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-06 02:31:13 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-06 02:31:13 -0600 |
commit | 0ae5679aa160245af248836e1d7743aeff63f2e1 (patch) | |
tree | 64608dccc9bfd57800995a414f6287b7605ca637 /kinit | |
parent | d3b5575f31f14629dbd3fd900665e1a69aa7bcd5 (diff) | |
download | tdelibs-0ae5679aa160245af248836e1d7743aeff63f2e1.tar.gz tdelibs-0ae5679aa160245af248836e1d7743aeff63f2e1.zip |
Additional kde to tde renaming
Diffstat (limited to 'kinit')
-rw-r--r-- | kinit/CMakeLists.txt | 38 | ||||
-rw-r--r-- | kinit/Mainpage.dox | 8 | ||||
-rw-r--r-- | kinit/Makefile.am | 34 | ||||
-rw-r--r-- | kinit/README | 28 | ||||
-rw-r--r-- | kinit/README.wrapper | 22 | ||||
-rw-r--r-- | kinit/configure.in.in | 12 | ||||
-rw-r--r-- | kinit/kinit.cpp | 174 | ||||
-rw-r--r-- | kinit/klauncher.cpp | 86 | ||||
-rw-r--r-- | kinit/klauncher.h | 8 | ||||
-rw-r--r-- | kinit/klauncher_cmds.h | 14 | ||||
-rw-r--r-- | kinit/klauncher_main.cpp | 4 | ||||
-rw-r--r-- | kinit/setproctitle.cpp | 4 | ||||
-rw-r--r-- | kinit/setproctitle.h | 4 | ||||
-rw-r--r-- | kinit/start_kdeinit.c | 8 | ||||
-rw-r--r-- | kinit/start_kdeinit_wrapper.c | 20 | ||||
-rw-r--r-- | kinit/tests/klaunchertest.cpp | 2 | ||||
-rw-r--r-- | kinit/wrapper.c | 14 |
17 files changed, 240 insertions, 240 deletions
diff --git a/kinit/CMakeLists.txt b/kinit/CMakeLists.txt index c64bcfc33..d5b637ee4 100644 --- a/kinit/CMakeLists.txt +++ b/kinit/CMakeLists.txt @@ -14,11 +14,11 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/kdecore + ${CMAKE_BINARY_DIR}/tdecore ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/kdecore - ${CMAKE_SOURCE_DIR}/kdeui + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui ${CMAKE_SOURCE_DIR}/kio ${CMAKE_SOURCE_DIR}/kio/kio ${FREETYPE_INCLUDE_DIRS} @@ -29,9 +29,9 @@ link_directories( ) -#### kdeinit #################################### +#### tdeinit #################################### -set( target kdeinit ) +set( target tdeinit ) set( ${target}_SRCS kinit.cpp setproctitle.cpp @@ -44,9 +44,9 @@ tde_add_executable( ${target} ) -#### kdeinit_wrapper ############################ +#### tdeinit_wrapper ############################ -set( target kdeinit_wrapper ) +set( target tdeinit_wrapper ) tde_add_executable( ${target} SOURCES wrapper.c @@ -64,9 +64,9 @@ tde_add_executable( ${target} ) -#### kdeinit_shutdown ########################### +#### tdeinit_shutdown ########################### -set( target kdeinit_shutdown ) +set( target tdeinit_shutdown ) tde_add_executable( ${target} SOURCES wrapper.c @@ -111,7 +111,7 @@ set( target kstartupconfig ) tde_add_executable( ${target} AUTOMOC SOURCES kstartupconfig.cpp - LINK kdefakes-shared ${TQT_LIBRARIES} + LINK tdefakes-shared ${TQT_LIBRARIES} DESTINATION ${BIN_INSTALL_DIR} ) @@ -122,33 +122,33 @@ set( target kdostartupconfig ) tde_add_executable( ${target} AUTOMOC SOURCES kdostartupconfig.cpp - LINK kdecore-shared + LINK tdecore-shared DESTINATION ${BIN_INSTALL_DIR} ) -#### start_kdeinit ############################## +#### start_tdeinit ############################## -set( target start_kdeinit ) +set( target start_tdeinit ) if( KDEINIT_SETUID ) set( _setuid SETUID ) endif( KDEINIT_SETUID ) tde_add_executable( ${target} ${_setuid} - SOURCES start_kdeinit.c + SOURCES start_tdeinit.c DESTINATION ${BIN_INSTALL_DIR} ) -set_target_properties( ${target} PROPERTIES COMPILE_FLAGS -DEXECUTE=\\"${BIN_INSTALL_DIR}/kdeinit\\" ) +set_target_properties( ${target} PROPERTIES COMPILE_FLAGS -DEXECUTE=\\"${BIN_INSTALL_DIR}/tdeinit\\" ) -#### start_kdeinit_wrapper ###################### +#### start_tdeinit_wrapper ###################### -set( target start_kdeinit_wrapper ) +set( target start_tdeinit_wrapper ) tde_add_executable( ${target} - SOURCES start_kdeinit_wrapper.c + SOURCES start_tdeinit_wrapper.c DESTINATION ${BIN_INSTALL_DIR} ) @@ -161,7 +161,7 @@ set( ${target}_SRCS klauncher.cpp klauncher_main.cpp autostart.cpp ) -tde_add_kdeinit_executable( ${target} AUTOMOC +tde_add_tdeinit_executable( ${target} AUTOMOC SOURCES ${${target}_SRCS} LINK kio-shared ) diff --git a/kinit/Mainpage.dox b/kinit/Mainpage.dox index 5f76313c7..06a34909b 100644 --- a/kinit/Mainpage.dox +++ b/kinit/Mainpage.dox @@ -1,6 +1,6 @@ /** @mainpage Trinity Initialization Routines -kdeinit is a process launcher somewhat similar to the +tdeinit is a process launcher somewhat similar to the famous init used for booting UNIX. <p> It launches processes by forking and then loading a @@ -8,8 +8,8 @@ dynamic library which should contain a 'main(...)' function. This both increases the startup speed and reduces the memory consumption of Trinity applications. -kdeinit_wrapper, kshell and kwrapper provide methods -of starting programs via kdeinit. +tdeinit_wrapper, kshell and kwrapper provide methods +of starting programs via tdeinit. @authors Waldo Bastian \<bastian@kde.org\><br> @@ -24,6 +24,6 @@ Most code is @lgpl */ -// DOXYGEN_REFERENCES = kdecore +// DOXYGEN_REFERENCES = tdecore // DOXYGEN_SET_PROJECT_NAME = KInit // vim:ts=4:sw=4:expandtab:filetype=doxygen diff --git a/kinit/Makefile.am b/kinit/Makefile.am index 05d8dd8ce..952f32a46 100644 --- a/kinit/Makefile.am +++ b/kinit/Makefile.am @@ -19,35 +19,35 @@ INCLUDES = -I$(srcdir)/../libltdl/ $(all_includes) $(KDEINIT_XFT_INCLUDES) SUBDIRS = . tests -bin_PROGRAMS = kdeinit kdeinit_wrapper kshell kdeinit_shutdown lnusertemp kwrapper kioslave \ - kstartupconfig kdostartupconfig start_kdeinit start_kdeinit_wrapper +bin_PROGRAMS = tdeinit tdeinit_wrapper kshell tdeinit_shutdown lnusertemp kwrapper kioslave \ + kstartupconfig kdostartupconfig start_tdeinit start_tdeinit_wrapper lib_LTLIBRARIES = -kdeinit_LTLIBRARIES = klauncher.la -kdeinit_SOURCES = kinit.cpp setproctitle.cpp +tdeinit_LTLIBRARIES = klauncher.la +tdeinit_SOURCES = kinit.cpp setproctitle.cpp # NOTE: We link against all common libraries even if we don't need them ourselves. # For the future: examine if condensing the tons of *_LDFLAGS variables # into $(all_libraries) isn't better AM_LDFLAGS = $(LDFLAGS_AS_NEEDED) $(LDFLAGS_NEW_DTAGS) -kdeinit_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ +tdeinit_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ $(KDE_RPATH) -kdeinit_LDADD = $(LIB_KPARTS) -lXft $(LIB_QT) +tdeinit_LDADD = $(LIB_KPARTS) -lXft $(LIB_QT) kioslave_SOURCES = kioslave.cpp kioslave_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ $(KDE_RPATH) kioslave_LDADD = $(LIB_KIO) -kdeinit_wrapper_SOURCES = wrapper.c -kdeinit_wrapper_LDADD = $(LIBSOCKET) +tdeinit_wrapper_SOURCES = wrapper.c +tdeinit_wrapper_LDADD = $(LIBSOCKET) kshell_SOURCES = shell.c kshell_LDADD = $(LIBSOCKET) -kdeinit_shutdown_SOURCES = wrapper.c -kdeinit_shutdown_LDADD = $(LIBSOCKET) +tdeinit_shutdown_SOURCES = wrapper.c +tdeinit_shutdown_LDADD = $(LIBSOCKET) lnusertemp_SOURCES = lnusertemp.c lnusertemp_LDFLAGS = $(KDE_RPATH) @@ -60,18 +60,18 @@ klauncher_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/dcop/l klauncher_la_SOURCES = klauncher.cpp klauncher_main.cpp autostart.cpp kstartupconfig_SOURCES = kstartupconfig.cpp -kstartupconfig_LDADD = $(top_builddir)/kdecore/libtdefakes.la $(LIB_QT) +kstartupconfig_LDADD = $(top_builddir)/tdecore/libtdefakes.la $(LIB_QT) kdostartupconfig_SOURCES = kdostartupconfig.cpp kdostartupconfig_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ $(KDE_RPATH) kdostartupconfig_LDADD = $(LIB_KDECORE) -start_kdeinit_SOURCES = start_kdeinit.c -kdeinitpath = $(bindir)/kdeinit -start_kdeinit_CFLAGS = $(KDE_USE_FPIE) -DEXECUTE=\"$(kdeinitpath)\" -start_kdeinit_LDFLAGS = $(KDE_USE_PIE) +start_tdeinit_SOURCES = start_tdeinit.c +tdeinitpath = $(bindir)/tdeinit +start_tdeinit_CFLAGS = $(KDE_USE_FPIE) -DEXECUTE=\"$(tdeinitpath)\" +start_tdeinit_LDFLAGS = $(KDE_USE_PIE) -start_kdeinit_wrapper_SOURCES = start_kdeinit_wrapper.c +start_tdeinit_wrapper_SOURCES = start_tdeinit_wrapper.c METASOURCES = AUTO @@ -86,7 +86,7 @@ dummy.cpp: install-exec-hook: @if test \${KDEINIT_SETUID} != 0; then \ - (chown 0 $(DESTDIR)$(bindir)/start_kdeinit && chmod 4755 $(DESTDIR)$(bindir)/start_kdeinit) || echo "Please make start_kdeinit setuid root" ; \ + (chown 0 $(DESTDIR)$(bindir)/start_tdeinit && chmod 4755 $(DESTDIR)$(bindir)/start_tdeinit) || echo "Please make start_tdeinit setuid root" ; \ fi include $(top_srcdir)/admin/Doxyfile.am diff --git a/kinit/README b/kinit/README index 624847a47..2e5f6c236 100644 --- a/kinit/README +++ b/kinit/README @@ -1,6 +1,6 @@ README -kdeinit is a process launcher somewhat similar to the +tdeinit is a process launcher somewhat similar to the famous init used for booting UNIX. It launches processes by forking and then loading a @@ -10,7 +10,7 @@ function. Executive summary ================= -Using kdeinit to launch KDE applications makes starting +Using tdeinit to launch KDE applications makes starting a typical KDE applications 2.5 times faster (100ms instead of 250ms on a P-III 500) It reduces memory consumption by approx. 350Kb per application. @@ -19,7 +19,7 @@ consumption by approx. 350Kb per application. How it works ============ -kdeinit is linked against all libraries a standard KDE +tdeinit is linked against all libraries a standard KDE application needs. With this technique starting an application becomes much faster because now only the application itself needs to be linked whereas @@ -31,7 +31,7 @@ Startup Speed Starting an application linked against libqt, libtdecore and libtdeui in the conventional way takes approx. 150ms on a Pentium III - 500Mhz. -Starting the same application via kdeinit takes less than 10ms. +Starting the same application via tdeinit takes less than 10ms. (application without KApplication constructor, the KApplication constructor requires an extra 100ms in both cases) @@ -42,24 +42,24 @@ Memory Usage An application linked against libqt, libtdecore and libtdeui started in the conventional way requires about 498Kb memory. (average of 10 instances) If the same application is started via -kdeinit it requires about 142Kb. A difference of 356Kb (application +tdeinit it requires about 142Kb. A difference of 356Kb (application without KApplication constructor) If we take the KApplication constructor into account, an application started in the conventional way takes about 679Kb memory while the same -application started via kdeinit requires about 380Kb. Here the difference +application started via tdeinit requires about 380Kb. Here the difference is somewhat less, 299Kb. This seems to be caused by the fact that the dynamic linker does "lazy linking". We can force the linker to link -everything at startup by specifying "LD_BIND_NOW=true". When kdeinit is -started with this option on, kdeinit is back to its full efficiency, an +everything at startup by specifying "LD_BIND_NOW=true". When tdeinit is +started with this option on, tdeinit is back to its full efficiency, an application with a KApplication constructor now uses 338Kb of memory. A difference of 341Kb with the normal case. -Adapting programs to use kdeinit. +Adapting programs to use tdeinit. =============================== The sourcecode of a program does not require any change to take advantage -of kdeinit. Only the makefile requires an adaption, if the Makefile.am of +of tdeinit. Only the makefile requires an adaption, if the Makefile.am of a normal program looks like this: bin_PROGRAMS = kicker @@ -67,7 +67,7 @@ kicker_LDADD = $(top_builddir)/libkonq/libkonq.la kicker_LDFLAGS = $(all_libraries) $(KDE_RPATH) The following lines need to be added to make a library version useable -by kdeinit: +by tdeinit: lib_LTLIBRARIES = kicker.la libkicker_la_LIBADD = $(top_builddir)/libkonq/libkonq.la @@ -76,9 +76,9 @@ libkicker_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module Disadvantages ============= -The process name of applications started via kdeinit is "kdeinit". This problem +The process name of applications started via tdeinit is "tdeinit". This problem can be corrected to a degree by changing the application name as shown -by 'ps'. However, applications like "killall" will only see "kdeinit" as +by 'ps'. However, applications like "killall" will only see "tdeinit" as process name. To workaround this, use "kdekillall", from kdesdk/scripts, -for applications started via kdeinit. +for applications started via tdeinit. diff --git a/kinit/README.wrapper b/kinit/README.wrapper index 48bfdc7e8..077d2b870 100644 --- a/kinit/README.wrapper +++ b/kinit/README.wrapper @@ -1,24 +1,24 @@ README -kdeinit_wrapper, kshell and kwrapper are a programs that -start programs via kdeinit. +tdeinit_wrapper, kshell and kwrapper are a programs that +start programs via tdeinit. E.g. You can make a symbolic link from $KDEDIR/bin/konsole to -$KDEDIR/bin/kdeinit_wrapper. Typing 'konsole' on the command line -will then start 'konsole.la' through kdeinit instead. +$KDEDIR/bin/tdeinit_wrapper. Typing 'konsole' on the command line +will then start 'konsole.la' through tdeinit instead. -kdeinit_wrapper is the simplest for, it only passes the program -and arguments to kdeinit, nothing else +tdeinit_wrapper is the simplest for, it only passes the program +and arguments to tdeinit, nothing else kshell is usually the best choice, it passes the program, arguments, complete environment ( $PATH, etc. ) and current -working directory to kdeinit +working directory to tdeinit kwrapper tries to make the program look like it was actually -really started directly and not via kdeinit. In addition to +really started directly and not via tdeinit. In addition to what kshell does, it also tries to redirect the program output to the console from which kwrapper was started, it waits -for the program started via kdeinit to finish and only after then +for the program started via tdeinit to finish and only after then it exits ( it doesn't return its return value though ), and it also passes most signals it gets to the process of the started program ( thus allowing you to break it using Ctrl+C or stopping @@ -31,8 +31,8 @@ TODO ==== * There is no portable way to read out the complete environment and - pass it to kdeinit. - kdeinit should probably unset every + pass it to tdeinit. - tdeinit should probably unset every variable that's not set in the environment it gets from kshell or kwrapper * stdout/stderr of the started application goes to the console where - kdeinit was started. - done, I hope it's ok + tdeinit was started. - done, I hope it's ok diff --git a/kinit/configure.in.in b/kinit/configure.in.in index 2ba692872..6330594b6 100644 --- a/kinit/configure.in.in +++ b/kinit/configure.in.in @@ -28,24 +28,24 @@ fi KDE_FIND_PATH(freetype-config, KDEINIT_FREETYPE_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin]) if test -n "$KDEINIT_FREETYPE_CONFIG"; then KDEINIT_XFT_INCLUDES="`$KDEINIT_FREETYPE_CONFIG --cflags` $FONTCONFIG_CFLAGS" - kdeinit_cppflags=$CPPFLAGS + tdeinit_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $KDEINIT_XFT_INCLUDES $FONTCONFIG_CFLAGS" KDE_CHECK_HEADER(X11/Xft/Xft.h,[],[KDEINIT_USE_XFT=]) - CPPFLAGS=$kdeinit_cppflags + CPPFLAGS=$tdeinit_cppflags else KDEINIT_USE_XFT= fi if test -n "$KDEINIT_USE_XFT"; then - AC_DEFINE(KDEINIT_USE_XFT,1,[Use Xft preinitialization in kdeinit]) + AC_DEFINE(KDEINIT_USE_XFT,1,[Use Xft preinitialization in tdeinit]) fi if test -n "$KDEINIT_FONTCONFIG"; then - AC_DEFINE(KDEINIT_USE_FONTCONFIG,1,[Use FontConfig in kdeinit]) + AC_DEFINE(KDEINIT_USE_FONTCONFIG,1,[Use FontConfig in tdeinit]) fi AC_SUBST(KDEINIT_XFT_INCLUDES) -AC_MSG_CHECKING(whether to make kdeinit setuid root in order to protect it from bad Linux OOM-killer) -kdeinit_setuid= +AC_MSG_CHECKING(whether to make tdeinit setuid root in order to protect it from bad Linux OOM-killer) +tdeinit_setuid= case $target_os in linux*) AC_MSG_RESULT(yes) diff --git a/kinit/kinit.cpp b/kinit/kinit.cpp index bda7a7d35..2527dfb56 100644 --- a/kinit/kinit.cpp +++ b/kinit/kinit.cpp @@ -161,8 +161,8 @@ static struct { //#if defined Q_WS_X11 && ! defined K_WS_QTONLY #ifdef Q_WS_X11 extern "C" { -int kdeinit_xio_errhandler( Display * ); -int kdeinit_x_errhandler( Display *, XErrorEvent *err ); +int tdeinit_xio_errhandler( Display * ); +int tdeinit_x_errhandler( Display *, XErrorEvent *err ); } #endif @@ -256,25 +256,25 @@ static void setup_tty( const char* tty ) int fd = open( tty, O_WRONLY ); if( fd < 0 ) { - fprintf(stderr, "kdeinit: couldn't open() %s: %s\n", tty, strerror (errno) ); + fprintf(stderr, "tdeinit: couldn't open() %s: %s\n", tty, strerror (errno) ); return; } if( dup2( fd, STDOUT_FILENO ) < 0 ) { - fprintf(stderr, "kdeinit: couldn't dup2() %s: %s\n", tty, strerror (errno) ); + fprintf(stderr, "tdeinit: couldn't dup2() %s: %s\n", tty, strerror (errno) ); close( fd ); return; } if( dup2( fd, STDERR_FILENO ) < 0 ) { - fprintf(stderr, "kdeinit: couldn't dup2() %s: %s\n", tty, strerror (errno) ); + fprintf(stderr, "tdeinit: couldn't dup2() %s: %s\n", tty, strerror (errno) ); close( fd ); return; } close( fd ); } -// from kdecore/netwm.cpp +// from tdecore/netwm.cpp static int get_current_desktop( Display* disp ) { int desktop = 0; // no desktop by default @@ -435,7 +435,7 @@ static pid_t launch(int argc, const char *_name, const char *args, */ if (0 > socketpair(AF_UNIX, SOCK_STREAM, 0, d.launcher)) { - perror("kdeinit: socketpair() failed!\n"); + perror("tdeinit: socketpair() failed!\n"); exit(255); } launcher = 1; @@ -470,7 +470,7 @@ static pid_t launch(int argc, const char *_name, const char *args, if (0 > pipe(d.fd)) { - perror("kdeinit: pipe() failed!\n"); + perror("tdeinit: pipe() failed!\n"); d.result = 3; d.errorMsg = i18n("Unable to start new process.\n" "The system may have reached the maximum number of open files possible or the maximum number of open files that you are allowed to use has been reached.").utf8(); @@ -492,7 +492,7 @@ static pid_t launch(int argc, const char *_name, const char *args, d.fork = fork(); switch(d.fork) { case -1: - perror("kdeinit: fork() failed!\n"); + perror("tdeinit: fork() failed!\n"); d.result = 3; d.errorMsg = i18n("Unable to create new process.\n" "The system may have reached the maximum number of processes possible or the maximum number of processes that you are allowed to use has been reached.").utf8(); @@ -575,11 +575,11 @@ static pid_t launch(int argc, const char *_name, const char *args, /* set the process name, so that killall works like intended */ r = prctl(PR_SET_NAME, (unsigned long) name.data(), 0, 0, 0); if ( r == 0 ) - kdeinit_setproctitle( "%s [kdeinit]%s", name.data(), procTitle.data() ? procTitle.data() : "" ); + tdeinit_setproctitle( "%s [tdeinit]%s", name.data(), procTitle.data() ? procTitle.data() : "" ); else - kdeinit_setproctitle( "kdeinit: %s%s", name.data(), procTitle.data() ? procTitle.data() : "" ); + tdeinit_setproctitle( "tdeinit: %s%s", name.data(), procTitle.data() ? procTitle.data() : "" ); #else - kdeinit_setproctitle( "kdeinit: %s%s", name.data(), procTitle.data() ? procTitle.data() : "" ); + tdeinit_setproctitle( "tdeinit: %s%s", name.data(), procTitle.data() ? procTitle.data() : "" ); #endif } @@ -632,7 +632,7 @@ static pid_t launch(int argc, const char *_name, const char *args, exit(255); } - d.sym = lt_dlsym( d.handle, "kdeinitmain"); + d.sym = lt_dlsym( d.handle, "tdeinitmain"); if (!d.sym ) { d.sym = lt_dlsym( d.handle, "kdemain" ); @@ -659,9 +659,9 @@ static pid_t launch(int argc, const char *_name, const char *args, d.func = (int (*)(int, char *[])) d.sym; if (d.debug_wait) { - fprintf(stderr, "kdeinit: Suspending process\n" - "kdeinit: 'gdb kdeinit %d' to debug\n" - "kdeinit: 'kill -SIGCONT %d' to continue\n", + fprintf(stderr, "tdeinit: Suspending process\n" + "tdeinit: 'gdb tdeinit %d' to debug\n" + "tdeinit: 'kill -SIGCONT %d' to continue\n", getpid(), getpid()); kill(getpid(), SIGSTOP); } @@ -728,11 +728,11 @@ static pid_t launch(int argc, const char *_name, const char *args, } if (d.n == 0) { - perror("kdeinit: Pipe closed unexpectedly"); + perror("tdeinit: Pipe closed unexpectedly"); d.result = 1; // Error break; } - perror("kdeinit: Error reading from pipe"); + perror("tdeinit: Error reading from pipe"); d.result = 1; // Error break; } @@ -777,20 +777,20 @@ static void init_signals() if (pipe(d.deadpipe) != 0) { - perror("kdeinit: Aborting. Can't create pipe: "); + perror("tdeinit: Aborting. Can't create pipe: "); exit(255); } options = fcntl(d.deadpipe[0], F_GETFL); if (options == -1) { - perror("kdeinit: Aborting. Can't make pipe non-blocking: "); + perror("tdeinit: Aborting. Can't make pipe non-blocking: "); exit(255); } if (fcntl(d.deadpipe[0], F_SETFL, options | O_NONBLOCK) == -1) { - perror("kdeinit: Aborting. Can't make pipe non-blocking: "); + perror("tdeinit: Aborting. Can't make pipe non-blocking: "); exit(255); } @@ -821,7 +821,7 @@ static void init_signals() sigaction( SIGPIPE, &act, 0L); } -static void init_kdeinit_socket() +static void init_tdeinit_socket() { struct sockaddr_un sa; struct sockaddr_un sa_old; @@ -831,7 +831,7 @@ static void init_kdeinit_socket() int max_tries = 10; if (!home_dir || !home_dir[0]) { - fprintf(stderr, "kdeinit: Aborting. $HOME not set!"); + fprintf(stderr, "tdeinit: Aborting. $HOME not set!"); exit(255); } chdir(home_dir); @@ -843,12 +843,12 @@ static void init_kdeinit_socket() { if (errno == ENOENT) { - fprintf(stderr, "kdeinit: Aborting. $HOME directory (%s) does not exist.\n", path.data()); + fprintf(stderr, "tdeinit: Aborting. $HOME directory (%s) does not exist.\n", path.data()); exit(255); } else if (readOnly.isEmpty()) { - fprintf(stderr, "kdeinit: Aborting. No write access to $HOME directory (%s).\n", path.data()); + fprintf(stderr, "tdeinit: Aborting. No write access to $HOME directory (%s).\n", path.data()); exit(255); } } @@ -860,7 +860,7 @@ static void init_kdeinit_socket() } if (access(path.data(), R_OK|W_OK) && (errno != ENOENT)) { - fprintf(stderr, "kdeinit: Aborting. No write access to '%s'.\n", path.data()); + fprintf(stderr, "tdeinit: Aborting. No write access to '%s'.\n", path.data()); exit(255); } } @@ -874,7 +874,7 @@ static void init_kdeinit_socket() int s; struct sockaddr_un server; -// fprintf(stderr, "kdeinit: Warning, socket_file already exists!\n"); +// fprintf(stderr, "tdeinit: Warning, socket_file already exists!\n"); /* * create the socket stream */ @@ -890,7 +890,7 @@ static void init_kdeinit_socket() if(connect(s, (struct sockaddr *)&server, socklen) == 0) { - fprintf(stderr, "kdeinit: Shutting down running client.\n"); + fprintf(stderr, "tdeinit: Shutting down running client.\n"); klauncher_header request_header; request_header.cmd = LAUNCHER_TERMINATE_KDEINIT; request_header.arg_length = 0; @@ -908,21 +908,21 @@ static void init_kdeinit_socket() d.wrapper = socket(PF_UNIX, SOCK_STREAM, 0); if (d.wrapper < 0) { - perror("kdeinit: Aborting. socket() failed: "); + perror("tdeinit: Aborting. socket() failed: "); exit(255); } options = fcntl(d.wrapper, F_GETFL); if (options == -1) { - perror("kdeinit: Aborting. Can't make socket non-blocking: "); + perror("tdeinit: Aborting. Can't make socket non-blocking: "); close(d.wrapper); exit(255); } if (fcntl(d.wrapper, F_SETFL, options | O_NONBLOCK) == -1) { - perror("kdeinit: Aborting. Can't make socket non-blocking: "); + perror("tdeinit: Aborting. Can't make socket non-blocking: "); close(d.wrapper); exit(255); } @@ -936,7 +936,7 @@ static void init_kdeinit_socket() if(bind(d.wrapper, (struct sockaddr *)&sa, socklen) != 0) { if (max_tries == 0) { - perror("kdeinit: Aborting. bind() failed: "); + perror("tdeinit: Aborting. bind() failed: "); fprintf(stderr, "Could not bind to socket '%s'\n", sock_file); close(d.wrapper); exit(255); @@ -949,7 +949,7 @@ static void init_kdeinit_socket() /** set permissions **/ if (chmod(sock_file, 0600) != 0) { - perror("kdeinit: Aborting. Can't set permissions on socket: "); + perror("tdeinit: Aborting. Can't set permissions on socket: "); fprintf(stderr, "Wrong permissions of socket '%s'\n", sock_file); unlink(sock_file); close(d.wrapper); @@ -958,7 +958,7 @@ static void init_kdeinit_socket() if(listen(d.wrapper, SOMAXCONN) < 0) { - perror("kdeinit: Aborting. listen() failed: "); + perror("tdeinit: Aborting. listen() failed: "); unlink(sock_file); close(d.wrapper); exit(255); @@ -968,14 +968,14 @@ static void init_kdeinit_socket() d.wrapper_old = socket(PF_UNIX, SOCK_STREAM, 0); if (d.wrapper_old < 0) { - // perror("kdeinit: Aborting. socket() failed: "); + // perror("tdeinit: Aborting. socket() failed: "); return; } options = fcntl(d.wrapper_old, F_GETFL); if (options == -1) { - // perror("kdeinit: Aborting. Can't make socket non-blocking: "); + // perror("tdeinit: Aborting. Can't make socket non-blocking: "); close(d.wrapper_old); d.wrapper_old = 0; return; @@ -983,7 +983,7 @@ static void init_kdeinit_socket() if (fcntl(d.wrapper_old, F_SETFL, options | O_NONBLOCK) == -1) { - // perror("kdeinit: Aborting. Can't make socket non-blocking: "); + // perror("tdeinit: Aborting. Can't make socket non-blocking: "); close(d.wrapper_old); d.wrapper_old = 0; return; @@ -999,7 +999,7 @@ static void init_kdeinit_socket() if(bind(d.wrapper_old, (struct sockaddr *)&sa_old, socklen) != 0) { if (max_tries == 0) { - // perror("kdeinit: Aborting. bind() failed: "); + // perror("tdeinit: Aborting. bind() failed: "); fprintf(stderr, "Could not bind to socket '%s'\n", sock_file_old); close(d.wrapper_old); d.wrapper_old = 0; @@ -1022,7 +1022,7 @@ static void init_kdeinit_socket() if(listen(d.wrapper_old, SOMAXCONN) < 0) { - // perror("kdeinit: Aborting. listen() failed: "); + // perror("tdeinit: Aborting. listen() failed: "); unlink(sock_file_old); close(d.wrapper_old); d.wrapper_old = 0; @@ -1069,14 +1069,14 @@ static void launcher_died() if (!d.launcher_ok) { /* This is bad. */ - fprintf(stderr, "kdeinit: Communication error with launcher. Exiting!\n"); + fprintf(stderr, "tdeinit: Communication error with launcher. Exiting!\n"); ::exit(255); return; } // KLauncher died... restart #ifndef NDEBUG - fprintf(stderr, "kdeinit: KLauncher died unexpectedly.\n"); + fprintf(stderr, "tdeinit: KLauncher died unexpectedly.\n"); #endif // Make sure it's really dead. if (d.launcher_pid) @@ -1092,7 +1092,7 @@ static void launcher_died() pid_t pid = launch( 1, "klauncher", 0 ); #ifndef NDEBUG - fprintf(stderr, "kdeinit: Relaunching KLauncher, pid = %ld result = %d\n", (long) pid, d.result); + fprintf(stderr, "tdeinit: Relaunching KLauncher, pid = %ld result = %d\n", (long) pid, d.result); #endif } @@ -1156,7 +1156,7 @@ static void handle_launcher_request(int sock = -1) const char *startup_id_str = "0"; #ifndef NDEBUG - fprintf(stderr, "kdeinit: Got %s '%s' from %s.\n", + fprintf(stderr, "tdeinit: Got %s '%s' from %s.\n", (request_header.cmd == LAUNCHER_EXEC ? "EXEC" : (request_header.cmd == LAUNCHER_EXT_EXEC ? "EXT_EXEC" : (request_header.cmd == LAUNCHER_EXEC_NEW ? "EXEC_NEW" : @@ -1218,7 +1218,7 @@ static void handle_launcher_request(int sock = -1) if ((arg_n - request_data) != request_header.arg_length) { #ifndef NDEBUG - fprintf(stderr, "kdeinit: EXEC request has invalid format.\n"); + fprintf(stderr, "tdeinit: EXEC request has invalid format.\n"); #endif free(request_data); d.debug_wait = false; @@ -1273,16 +1273,16 @@ static void handle_launcher_request(int sock = -1) #ifndef NDEBUG if (launcher) - fprintf(stderr, "kdeinit: Got SETENV '%s=%s' from klauncher.\n", env_name, env_value); + fprintf(stderr, "tdeinit: Got SETENV '%s=%s' from klauncher.\n", env_name, env_value); else - fprintf(stderr, "kdeinit: Got SETENV '%s=%s' from socket.\n", env_name, env_value); + fprintf(stderr, "tdeinit: Got SETENV '%s=%s' from socket.\n", env_name, env_value); #endif if ( request_header.arg_length != (int) (strlen(env_name) + strlen(env_value) + 2)) { #ifndef NDEBUG - fprintf(stderr, "kdeinit: SETENV request has invalid format.\n"); + fprintf(stderr, "tdeinit: SETENV request has invalid format.\n"); #endif free(request_data); return; @@ -1292,16 +1292,16 @@ static void handle_launcher_request(int sock = -1) else if (request_header.cmd == LAUNCHER_TERMINATE_KDE) { #ifndef NDEBUG - fprintf(stderr,"kdeinit: terminate KDE.\n"); + fprintf(stderr,"tdeinit: terminate KDE.\n"); #endif #ifdef Q_WS_X11 - kdeinit_xio_errhandler( 0L ); + tdeinit_xio_errhandler( 0L ); #endif } else if (request_header.cmd == LAUNCHER_TERMINATE_KDEINIT) { #ifndef NDEBUG - fprintf(stderr,"kdeinit: Killing kdeinit/klauncher.\n"); + fprintf(stderr,"tdeinit: Killing tdeinit/klauncher.\n"); #endif if (d.launcher_pid) kill(d.launcher_pid, SIGTERM); @@ -1311,7 +1311,7 @@ static void handle_launcher_request(int sock = -1) else if (request_header.cmd == LAUNCHER_DEBUG_WAIT) { #ifndef NDEBUG - fprintf(stderr,"kdeinit: Debug wait activated.\n"); + fprintf(stderr,"tdeinit: Debug wait activated.\n"); #endif d.debug_wait = true; } @@ -1351,7 +1351,7 @@ static void handle_requests(pid_t waitForPid) if (exit_pid > 0) { #ifndef NDEBUG - fprintf(stderr, "kdeinit: PID %ld terminated.\n", (long) exit_pid); + fprintf(stderr, "tdeinit: PID %ld terminated.\n", (long) exit_pid); #endif if (waitForPid && (exit_pid == waitForPid)) return; @@ -1463,7 +1463,7 @@ static void handle_requests(pid_t waitForPid) } } -static void kdeinit_library_path() +static void tdeinit_library_path() { TQStringList ltdl_library_path = TQStringList::split(':', TQFile::decodeName(getenv("LTDL_LIBRARY_PATH"))); @@ -1513,39 +1513,39 @@ static void kdeinit_library_path() TQCString display = getenv(DISPLAY); if (display.isEmpty()) { - fprintf(stderr, "kdeinit: Aborting. $"DISPLAY" is not set.\n"); + fprintf(stderr, "tdeinit: Aborting. $"DISPLAY" is not set.\n"); exit(255); } int i; if((i = display.findRev('.')) > display.findRev(':') && i >= 0) display.truncate(i); - TQCString socketName = TQFile::encodeName(locateLocal("socket", TQString("kdeinit-%1").arg(TQString(display)), s_instance)); + TQCString socketName = TQFile::encodeName(locateLocal("socket", TQString("tdeinit-%1").arg(TQString(display)), s_instance)); if (socketName.length() >= MAX_SOCK_FILE) { - fprintf(stderr, "kdeinit: Aborting. Socket name will be too long:\n"); + fprintf(stderr, "tdeinit: Aborting. Socket name will be too long:\n"); fprintf(stderr, " '%s'\n", socketName.data()); exit(255); } strcpy(sock_file_old, socketName.data()); display.replace(":","_"); - socketName = TQFile::encodeName(locateLocal("socket", TQString("kdeinit_%1").arg(TQString(display)), s_instance)); + socketName = TQFile::encodeName(locateLocal("socket", TQString("tdeinit_%1").arg(TQString(display)), s_instance)); if (socketName.length() >= MAX_SOCK_FILE) { - fprintf(stderr, "kdeinit: Aborting. Socket name will be too long:\n"); + fprintf(stderr, "tdeinit: Aborting. Socket name will be too long:\n"); fprintf(stderr, " '%s'\n", socketName.data()); exit(255); } strcpy(sock_file, socketName.data()); } -int kdeinit_xio_errhandler( Display *disp ) +int tdeinit_xio_errhandler( Display *disp ) { // disp is 0L when KDE shuts down. We don't want those warnings then. if ( disp ) - qWarning( "kdeinit: Fatal IO error: client killed" ); + qWarning( "tdeinit: Fatal IO error: client killed" ); if (sock_file[0]) { @@ -1567,7 +1567,7 @@ int kdeinit_xio_errhandler( Display *disp ) } if ( disp ) - qWarning( "kdeinit: sending SIGHUP to children." ); + qWarning( "tdeinit: sending SIGHUP to children." ); /* this should remove all children we started */ signal(SIGHUP, SIG_IGN); @@ -1576,27 +1576,27 @@ int kdeinit_xio_errhandler( Display *disp ) sleep(2); if ( disp ) - qWarning( "kdeinit: sending SIGTERM to children." ); + qWarning( "tdeinit: sending SIGTERM to children." ); /* and if they don't listen to us, this should work */ signal(SIGTERM, SIG_IGN); kill(0, SIGTERM); if ( disp ) - qWarning( "kdeinit: Exit." ); + qWarning( "tdeinit: Exit." ); exit( 0 ); return 0; } #ifdef Q_WS_X11 -int kdeinit_x_errhandler( Display *dpy, XErrorEvent *err ) +int tdeinit_x_errhandler( Display *dpy, XErrorEvent *err ) { #ifndef NDEBUG char errstr[256]; - // kdeinit almost doesn't use X, and therefore there shouldn't be any X error + // tdeinit almost doesn't use X, and therefore there shouldn't be any X error XGetErrorText( dpy, err->error_code, errstr, 256 ); - fprintf(stderr, "kdeinit: KDE detected X Error: %s %d\n" + fprintf(stderr, "tdeinit: KDE detected X Error: %s %d\n" " Major opcode: %d\n" " Minor opcode: %d\n" " Resource id: 0x%lx\n", @@ -1615,8 +1615,8 @@ int kdeinit_x_errhandler( Display *dpy, XErrorEvent *err ) // another X connection for startup notification purposes static void setupX() { - XSetIOErrorHandler(kdeinit_xio_errhandler); - XSetErrorHandler(kdeinit_x_errhandler); + XSetIOErrorHandler(tdeinit_xio_errhandler); + XSetErrorHandler(tdeinit_x_errhandler); } // Borrowed from kdebase/kaudio/kaudioserver.cpp @@ -1629,15 +1629,15 @@ static int initXconnection() BlackPixelOfScreen(DefaultScreenOfDisplay(X11display)), BlackPixelOfScreen(DefaultScreenOfDisplay(X11display)) ); #ifndef NDEBUG - fprintf(stderr, "kdeinit: opened connection to %s\n", DisplayString(X11display)); + fprintf(stderr, "tdeinit: opened connection to %s\n", DisplayString(X11display)); #endif int fd = XConnectionNumber( X11display ); int on = 1; (void) setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, (int) sizeof(on)); return fd; } else - fprintf(stderr, "kdeinit: Can't connect to the X Server.\n" \ - "kdeinit: Might not terminate at end of session.\n"); + fprintf(stderr, "tdeinit: Can't connect to the X Server.\n" \ + "tdeinit: Might not terminate at end of session.\n"); return -1; } @@ -1660,7 +1660,7 @@ static int initXconnection() /* Those 'unknown reasons' are C++ standard forbidding recursive calls to main() or any means that would possibly allow that (e.g. taking address of main()). - The correct solution is not using main() as entry point for kdeinit modules, + The correct solution is not using main() as entry point for tdeinit modules, but only kdemain(). */ extern "C" void _main(void); @@ -1714,7 +1714,7 @@ int main(int argc, char **argv, char **envp) #endif if (strcmp(safe_argv[i], "--help") == 0) { - printf("Usage: kdeinit [options]\n"); + printf("Usage: tdeinit [options]\n"); // printf(" --no-dcop Do not start dcopserver\n"); // printf(" --no-klauncher Do not start klauncher\n"); printf(" --no-kded Do not start kded\n"); @@ -1751,16 +1751,16 @@ int main(int argc, char **argv, char **envp) setsid(); /** Create our instance **/ - s_instance = new KInstance("kdeinit"); + s_instance = new KInstance("tdeinit"); /** Prepare to change process name **/ - kdeinit_initsetproctitle(argc, argv, envp); - kdeinit_library_path(); + tdeinit_initsetproctitle(argc, argv, envp); + tdeinit_library_path(); // Don't make our instance the global instance - // (do it only after kdeinit_library_path, that one indirectly uses KConfig, + // (do it only after tdeinit_library_path, that one indirectly uses KConfig, // which seems to be buggy and always use KGlobal instead of the maching KInstance) KGlobal::_instance = 0L; - // don't change envvars before kdeinit_initsetproctitle() + // don't change envvars before tdeinit_initsetproctitle() unsetenv("LD_BIND_NOW"); unsetenv("DYLD_BIND_AT_LAUNCH"); KApplication::loadedByKdeinit = true; @@ -1781,10 +1781,10 @@ int main(int argc, char **argv, char **envp) if (keep_running) { /* - * Create ~/.kde/tmp-<hostname>/kdeinit-<display> socket for incoming wrapper + * Create ~/.kde/tmp-<hostname>/tdeinit-<display> socket for incoming wrapper * requests. */ - init_kdeinit_socket(); + init_tdeinit_socket(); } if (launch_dcop) @@ -1794,12 +1794,12 @@ int main(int argc, char **argv, char **envp) else pid = launch( 2, "dcopserver", "--nosid" ); #ifndef NDEBUG - fprintf(stderr, "kdeinit: Launched DCOPServer, pid = %ld result = %d\n", (long) pid, d.result); + fprintf(stderr, "tdeinit: Launched DCOPServer, pid = %ld result = %d\n", (long) pid, d.result); #endif WaitPid(pid); if (!WIFEXITED(d.exit_status) || (WEXITSTATUS(d.exit_status) != 0)) { - fprintf(stderr, "kdeinit: DCOPServer could not be started, aborting.\n"); + fprintf(stderr, "tdeinit: DCOPServer could not be started, aborting.\n"); exit(1); } } @@ -1818,7 +1818,7 @@ int main(int argc, char **argv, char **envp) else pid = launch( 1, "klauncher", 0 ); #ifndef NDEBUG - fprintf(stderr, "kdeinit: Launched KLauncher, pid = %ld result = %d\n", (long) pid, d.result); + fprintf(stderr, "tdeinit: Launched KLauncher, pid = %ld result = %d\n", (long) pid, d.result); #endif handle_requests(pid); // Wait for klauncher to be ready } @@ -1856,7 +1856,7 @@ int main(int argc, char **argv, char **envp) else pid = launch( 1, "kded", 0 ); #ifndef NDEBUG - fprintf(stderr, "kdeinit: Launched KDED, pid = %ld result = %d\n", (long) pid, d.result); + fprintf(stderr, "tdeinit: Launched KDED, pid = %ld result = %d\n", (long) pid, d.result); #endif handle_requests(pid); } @@ -1867,7 +1867,7 @@ int main(int argc, char **argv, char **envp) { pid = launch( 1, safe_argv[i]+1, 0); #ifndef NDEBUG - fprintf(stderr, "kdeinit: Launched '%s', pid = %ld result = %d\n", safe_argv[i]+1, (long) pid, d.result); + fprintf(stderr, "tdeinit: Launched '%s', pid = %ld result = %d\n", safe_argv[i]+1, (long) pid, d.result); #endif handle_requests(pid); } @@ -1883,7 +1883,7 @@ int main(int argc, char **argv, char **envp) { pid = launch( 1, safe_argv[i], 0 ); #ifndef NDEBUG - fprintf(stderr, "kdeinit: Launched '%s', pid = %ld result = %d\n", safe_argv[i], (long) pid, d.result); + fprintf(stderr, "tdeinit: Launched '%s', pid = %ld result = %d\n", safe_argv[i], (long) pid, d.result); #endif } } @@ -1895,7 +1895,7 @@ int main(int argc, char **argv, char **envp) } free (safe_argv); - kdeinit_setproctitle("kdeinit Running..."); + tdeinit_setproctitle("tdeinit Running..."); if (!keep_running) return 0; diff --git a/kinit/klauncher.cpp b/kinit/klauncher.cpp index 4f2e12450..47b3b5f42 100644 --- a/kinit/klauncher.cpp +++ b/kinit/klauncher.cpp @@ -162,11 +162,11 @@ IdleSlave::age(time_t now) return (int) difftime(now, mBirthDate); } -KLauncher::KLauncher(int _kdeinitSocket, bool new_startup) +KLauncher::KLauncher(int _tdeinitSocket, bool new_startup) // : KApplication( false, false ), // No Styles, No GUI : KApplication( false, true ), // TQClipboard tries to construct a QWidget so a GUI is technically needed, even though it is not used DCOPObject("klauncher"), - kdeinitSocket(_kdeinitSocket), mAutoStart( new_startup ), + tdeinitSocket(_tdeinitSocket), mAutoStart( new_startup ), dontBlockReading(false), newStartup( new_startup ) { #ifdef Q_WS_X11 @@ -200,10 +200,10 @@ KLauncher::KLauncher(int _kdeinitSocket, bool new_startup) connect(&mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(idleTimeout())); - kdeinitNotifier = new TQSocketNotifier(kdeinitSocket, TQSocketNotifier::Read); - connect(kdeinitNotifier, TQT_SIGNAL( activated( int )), + tdeinitNotifier = new TQSocketNotifier(tdeinitSocket, TQSocketNotifier::Read); + connect(tdeinitNotifier, TQT_SIGNAL( activated( int )), this, TQT_SLOT( slotKDEInitData( int ))); - kdeinitNotifier->setEnabled( true ); + tdeinitNotifier->setEnabled( true ); lastRequest = 0; bProcessingQueue = false; @@ -221,7 +221,7 @@ KLauncher::KLauncher(int _kdeinitSocket, bool new_startup) klauncher_header request_header; request_header.cmd = LAUNCHER_OK; request_header.arg_length = 0; - write(kdeinitSocket, &request_header, sizeof(request_header)); + write(tdeinitSocket, &request_header, sizeof(request_header)); } KLauncher::~KLauncher() @@ -274,18 +274,18 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, if ((fun == "start_service_by_name(TQString,TQStringList)") || (fun == "start_service_by_desktop_path(TQString,TQStringList)")|| (fun == "start_service_by_desktop_name(TQString,TQStringList)")|| - (fun == "kdeinit_exec(TQString,TQStringList)") || - (fun == "kdeinit_exec_wait(TQString,TQStringList)") || + (fun == "tdeinit_exec(TQString,TQStringList)") || + (fun == "tdeinit_exec_wait(TQString,TQStringList)") || (fun == "start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString)") || (fun == "start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString)")|| (fun == "start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString)") || (fun == "start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)") || (fun == "start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)")|| (fun == "start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)") || - (fun == "kdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)") || - (fun == "kdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>)") || - (fun == "kdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)") || - (fun == "kdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) + (fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)") || + (fun == "tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>)") || + (fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)") || + (fun == "tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) { TQDataStream stream(data, IO_ReadOnly); bool bNoWait = false; @@ -306,11 +306,11 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, (fun == "start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString)")|| (fun == "start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) stream >> envs >> startup_id; - else if ((fun == "kdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)") || - (fun == "kdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>)")) + else if ((fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)") || + (fun == "tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>)")) stream >> envs; - else if ((fun == "kdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)") || - (fun == "kdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) + else if ((fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)") || + (fun == "tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) stream >> envs >> startup_id; bool finished; if (strncmp(fun, "start_service_by_name(", 22) == 0) @@ -328,17 +328,17 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, kdDebug(7016) << "KLauncher: Got start_service_by_desktop_name('" << serviceName << "', ...)" << endl; finished = start_service_by_desktop_name(serviceName, urls, envs, startup_id, bNoWait ); } - else if ((fun == "kdeinit_exec(TQString,TQStringList)") - || (fun == "kdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)") - || (fun == "kdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) + else if ((fun == "tdeinit_exec(TQString,TQStringList)") + || (fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)") + || (fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) { - kdDebug(7016) << "KLauncher: Got kdeinit_exec('" << serviceName << "', ...)" << endl; - finished = kdeinit_exec(serviceName, urls, envs, startup_id, false); + kdDebug(7016) << "KLauncher: Got tdeinit_exec('" << serviceName << "', ...)" << endl; + finished = tdeinit_exec(serviceName, urls, envs, startup_id, false); } else { - kdDebug(7016) << "KLauncher: Got kdeinit_exec_wait('" << serviceName << "', ...)" << endl; - finished = kdeinit_exec(serviceName, urls, envs, startup_id, true); + kdDebug(7016) << "KLauncher: Got tdeinit_exec_wait('" << serviceName << "', ...)" << endl; + finished = tdeinit_exec(serviceName, urls, envs, startup_id, true); } if (!finished) { @@ -413,7 +413,7 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, klauncher_header request_header; request_header.cmd = LAUNCHER_TERMINATE_KDE; request_header.arg_length = 0; - write(kdeinitSocket, &request_header, sizeof(request_header)); + write(tdeinitSocket, &request_header, sizeof(request_header)); destruct(0); } else if (fun == "autoStart()") @@ -459,16 +459,16 @@ KLauncher::functions() funcs << "serviceResult start_service_by_name(TQString,TQStringList)"; funcs << "serviceResult start_service_by_desktop_path(TQString,TQStringList)"; funcs << "serviceResult start_service_by_desktop_name(TQString,TQStringList)"; - funcs << "serviceResult kdeinit_exec(TQString,TQStringList)"; - funcs << "serviceResult kdeinit_exec_wait(TQString,TQStringList)"; + funcs << "serviceResult tdeinit_exec(TQString,TQStringList)"; + funcs << "serviceResult tdeinit_exec_wait(TQString,TQStringList)"; funcs << "serviceResult start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString)"; funcs << "serviceResult start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString)"; funcs << "serviceResult start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString)"; funcs << "serviceResult start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)"; funcs << "serviceResult start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)"; funcs << "serviceResult start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)"; - funcs << "serviceResult kdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)"; - funcs << "serviceResult kdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>)"; + funcs << "serviceResult tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)"; + funcs << "serviceResult tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>)"; funcs << "TQString requestSlave(TQString,TQString,TQString)"; funcs << "pid_t requestHoldSlave(KURL,TQString)"; funcs << "void waitForSlave(pid_t)"; @@ -491,8 +491,8 @@ void KLauncher::setLaunchEnv(const TQCString &name, const TQCString &_value) memcpy(requestData.data()+name.length()+1, value.data(), value.length()+1); request_header.cmd = LAUNCHER_SETENV; request_header.arg_length = requestData.size(); - write(kdeinitSocket, &request_header, sizeof(request_header)); - write(kdeinitSocket, requestData.data(), request_header.arg_length); + write(tdeinitSocket, &request_header, sizeof(request_header)); + write(tdeinitSocket, requestData.data(), request_header.arg_length); } /* @@ -529,19 +529,19 @@ KLauncher::slotKDEInitData(int) if( dontBlockReading ) { // in case we get a request to start an application and data arrive - // to kdeinitSocket at the same time, requestStart() will already + // to tdeinitSocket at the same time, requestStart() will already // call slotKDEInitData(), so we must check there's still something // to read, otherwise this would block fd_set in; timeval tm = { 0, 0 }; FD_ZERO ( &in ); - FD_SET( kdeinitSocket, &in ); - select( kdeinitSocket + 1, &in, 0, 0, &tm ); - if( !FD_ISSET( kdeinitSocket, &in )) + FD_SET( tdeinitSocket, &in ); + select( tdeinitSocket + 1, &in, 0, 0, &tm ); + if( !FD_ISSET( tdeinitSocket, &in )) return; } dontBlockReading = false; - int result = read_socket(kdeinitSocket, (char *) &request_header, + int result = read_socket(tdeinitSocket, (char *) &request_header, sizeof( request_header)); if (result == -1) { @@ -551,7 +551,7 @@ KLauncher::slotKDEInitData(int) destruct(255); // Exit! } requestData.resize(request_header.arg_length); - result = read_socket(kdeinitSocket, (char *) requestData.data(), + result = read_socket(tdeinitSocket, (char *) requestData.data(), request_header.arg_length); if (request_header.cmd == LAUNCHER_DIED) @@ -791,7 +791,7 @@ void KLauncher::requestStart(KLaunchRequest *request) { requestList.append( request ); - // Send request to kdeinit. + // Send request to tdeinit. klauncher_header request_header; TQByteArray requestData; int length = 0; @@ -865,14 +865,14 @@ KLauncher::requestStart(KLaunchRequest *request) request_header.cmd = LAUNCHER_EXEC_NEW; #endif request_header.arg_length = length; - write(kdeinitSocket, &request_header, sizeof(request_header)); - write(kdeinitSocket, requestData.data(), request_header.arg_length); + write(tdeinitSocket, &request_header, sizeof(request_header)); + write(tdeinitSocket, requestData.data(), request_header.arg_length); // Wait for pid to return. lastRequest = request; dontBlockReading = false; do { - slotKDEInitData( kdeinitSocket ); + slotKDEInitData( tdeinitSocket ); } while (lastRequest != 0); dontBlockReading = true; @@ -1090,7 +1090,7 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr ser data.setWMClass( wmclass ); if( silent ) data.setSilent( KStartupInfoData::Yes ); - // the rest will be sent by kdeinit + // the rest will be sent by tdeinit KStartupInfo::sendStartupX( dpy, id, data ); if( mCached_dpy != dpy && mCached_dpy != NULL ) XCloseDisplay( mCached_dpy ); @@ -1136,7 +1136,7 @@ KLauncher::cancel_service_startup_info( KLaunchRequest* request, const TQCString } bool -KLauncher::kdeinit_exec(const TQString &app, const TQStringList &args, +KLauncher::tdeinit_exec(const TQString &app, const TQStringList &args, const TQValueList<TQCString> &envs, TQCString startup_id, bool wait) { KLaunchRequest *request = new KLaunchRequest; @@ -1298,7 +1298,7 @@ KLauncher::requestSlave(const TQString &protocol, klauncher_header request_header; request_header.cmd = LAUNCHER_DEBUG_WAIT; request_header.arg_length = 0; - write(kdeinitSocket, &request_header, sizeof(request_header)); + write(tdeinitSocket, &request_header, sizeof(request_header)); } if (mSlaveValgrind == arg1) { diff --git a/kinit/klauncher.h b/kinit/klauncher.h index 5ff5b66c3..763d20e53 100644 --- a/kinit/klauncher.h +++ b/kinit/klauncher.h @@ -110,7 +110,7 @@ class KLauncher : public KApplication, public DCOPObject Q_OBJECT public: - KLauncher(int _kdeinitSocket, bool new_startup); + KLauncher(int _tdeinitSocket, bool new_startup); ~KLauncher(); @@ -141,7 +141,7 @@ protected: const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind); bool start_service_by_desktop_name(const TQString &serviceName, const TQStringList &urls, const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind); - bool kdeinit_exec(const TQString &app, const TQStringList &args, + bool tdeinit_exec(const TQString &app, const TQStringList &args, const TQValueList<TQCString> &envs, TQCString startup_id, bool wait); void waitForSlave(pid_t pid); @@ -176,8 +176,8 @@ public slots: protected: TQPtrList<KLaunchRequest> requestList; // Requests being handled TQPtrList<KLaunchRequest> requestQueue; // Requests waiting to being handled - int kdeinitSocket; - TQSocketNotifier *kdeinitNotifier; + int tdeinitSocket; + TQSocketNotifier *tdeinitNotifier; serviceResult DCOPresult; KLaunchRequest *lastRequest; TQPtrList<SlaveWaitRequest> mSlaveWaitRequest; diff --git a/kinit/klauncher_cmds.h b/kinit/klauncher_cmds.h index ff2993ad0..11105907b 100644 --- a/kinit/klauncher_cmds.h +++ b/kinit/klauncher_cmds.h @@ -44,7 +44,7 @@ typedef struct /* * LAUNCHER_SETENV * - * Change environment of future processes launched via kdeinit. + * Change environment of future processes launched via tdeinit. * DON'T use this if you want to change environment only for one * application you're going to start. * @@ -56,7 +56,7 @@ typedef struct /* * LAUNCHER_DIED * - * Notification A child of kdeinit died. + * Notification A child of tdeinit died. * * long pid; * long exit_code; @@ -94,7 +94,7 @@ typedef struct * char *envs: environment strings. * int avoid_loops : avoid using the first path in $PATH where * this process binary is found in order to avoid - * infinite loop by binary->kdeinit_wrapper link in $PATH + * infinite loop by binary->tdeinit_wrapper link in $PATH * char* startup_id: app startup notification id, "0" for none, * "" ( empty string ) is the default */ @@ -132,7 +132,7 @@ typedef struct * char *envs: environment strings. * int avoid_loops : avoid using the first path in $PATH where * this process binary is found in order to avoid - * infinite loop by binary->kdeinit_wrapper link in $PATH + * infinite loop by binary->tdeinit_wrapper link in $PATH * char* startup_id: app startup notification id, "0" for none, * "" ( empty string ) is the default * @@ -154,7 +154,7 @@ typedef struct * char *tty: tty to redirect stdout/stderr to. * int avoid_loops : avoid using the first path in $PATH where * this process binary is found in order to avoid - * infinite loop by binary->kdeinit_wrapper link in $PATH + * infinite loop by binary->tdeinit_wrapper link in $PATH * char* startup_id: app startup notification id, "0" for none, * "" ( empty string ) is the default */ @@ -174,12 +174,12 @@ typedef struct * char *envs: environment strings. * int avoid_loops : avoid using the first path in $PATH where * this process binary is found in order to avoid - * infinite loop by binary->kdeinit_wrapper link in $PATH + * infinite loop by binary->tdeinit_wrapper link in $PATH */ #define LAUNCHER_FD 42 /* - * File descriptor to use for communication with kdeinit. + * File descriptor to use for communication with tdeinit. */ #endif diff --git a/kinit/klauncher_main.cpp b/kinit/klauncher_main.cpp index 80b96980c..632c82a8c 100644 --- a/kinit/klauncher_main.cpp +++ b/kinit/klauncher_main.cpp @@ -52,11 +52,11 @@ static KCmdLineOptions options[] = extern "C" KDE_EXPORT int kdemain( int argc, char**argv ) { - // Started via kdeinit. + // Started via tdeinit. if (fcntl(LAUNCHER_FD, F_GETFD) == -1) { fprintf(stderr, "%s", i18n("klauncher: This program is not supposed to be started manually.\n" - "klauncher: It is started automatically by kdeinit.\n").local8Bit().data()); + "klauncher: It is started automatically by tdeinit.\n").local8Bit().data()); return 1; } diff --git a/kinit/setproctitle.cpp b/kinit/setproctitle.cpp index a326ef291..e6c85561c 100644 --- a/kinit/setproctitle.cpp +++ b/kinit/setproctitle.cpp @@ -134,7 +134,7 @@ char **Argv = NULL; /* pointer to argument vector */ char *LastArgv = NULL; /* end of argv */ void -kdeinit_initsetproctitle(int argc, char **argv, char **envp) +tdeinit_initsetproctitle(int argc, char **argv, char **envp) { register int i, envpsize = 0; #if !defined(HAVE_NSGETENVIRON) || !defined(HAVE_CRT_EXTERNS_H) @@ -287,7 +287,7 @@ setproctitle(const char *fmt, ...) /*VARARGS2*/ void -kdeinit_setproctitle(const char *fmt, ...) +tdeinit_setproctitle(const char *fmt, ...) { char buf[SPT_BUFSIZE]; diff --git a/kinit/setproctitle.h b/kinit/setproctitle.h index df400f4cb..7a134e73e 100644 --- a/kinit/setproctitle.h +++ b/kinit/setproctitle.h @@ -145,8 +145,8 @@ #endif -extern void kdeinit_initsetproctitle(int, char **, char **); -extern void kdeinit_setproctitle(const char *, ...) +extern void tdeinit_initsetproctitle(int, char **, char **); +extern void tdeinit_setproctitle(const char *, ...) #ifdef __GNUC__ __attribute__ (( format ( printf, 1, 2 ) ) ) #endif diff --git a/kinit/start_kdeinit.c b/kinit/start_kdeinit.c index a86b366e5..9d2626057 100644 --- a/kinit/start_kdeinit.c +++ b/kinit/start_kdeinit.c @@ -32,9 +32,9 @@ /* Prevent getting killed by bad heuristic in Linux OOM-killer. This wrapper decreases the chance OOM killer kills it (or its children, - namely kdeinit), opens a pipe and forks. Child drops privileges - and launches kdeinit. Since processes started by kdeinit should - not have this protection, kdeinit will after forking send the new + namely tdeinit), opens a pipe and forks. Child drops privileges + and launches tdeinit. Since processes started by tdeinit should + not have this protection, tdeinit will after forking send the new PID using the pipe and wait for a signal. This parent will reset the protection and SIGUSR1 the process to continue. returns 1 if pid is valid @@ -113,7 +113,7 @@ int main(int argc, char **argv) return 1; } close( pipes[ 0 ] ); - /* read original environment passed by start_kdeinit_wrapper */ + /* read original environment passed by start_tdeinit_wrapper */ if( read( 0, header, 7 ) == 7 && strncmp( header, "environ", 7 ) == 0 ) { unsigned count; if( read( 0, &count, sizeof( unsigned )) == sizeof( unsigned ) diff --git a/kinit/start_kdeinit_wrapper.c b/kinit/start_kdeinit_wrapper.c index bc6d0e31f..eb26b0387 100644 --- a/kinit/start_kdeinit_wrapper.c +++ b/kinit/start_kdeinit_wrapper.c @@ -26,11 +26,11 @@ #ifdef KDEINIT_OOM_PROTECT /* - The start_kdeinit wrapper is setuid, which means some shell variables like LD_LIBRARY_PATH - get unset before it's launched. However kdeinit is used to launch most of KDE, so such variables + The start_tdeinit wrapper is setuid, which means some shell variables like LD_LIBRARY_PATH + get unset before it's launched. However tdeinit is used to launch most of KDE, so such variables should not be dropped. Therefore this wrapper for the setuid wrapper read the environment - and writes it to start_kdeinit's stdin, which after dropping priviledges reads it and uses it - for launching the real kdeinit. + and writes it to start_tdeinit's stdin, which after dropping priviledges reads it and uses it + for launching the real tdeinit. */ int main(int argc, char **argv) { @@ -50,9 +50,9 @@ int main(int argc, char **argv) close( 0 ); /* stdin */ dup2( pipes[ 0 ], 0 ); close( pipes[ 0 ] ); - argv[ 0 ] = (char*)"start_kdeinit"; - execvp("start_kdeinit", argv); - perror("start_kdeinit"); + argv[ 0 ] = (char*)"start_tdeinit"; + execvp("start_tdeinit", argv); + perror("start_tdeinit"); return 1; case 0: { /* child, pass env and exit */ extern char** environ; @@ -84,9 +84,9 @@ int main(int argc, char **argv) { if(argc == 0) return 1; - argv[0] = "start_kdeinit"; - execvp("start_kdeinit",argv); - perror("start_kdeinit"); + argv[0] = "start_tdeinit"; + execvp("start_tdeinit",argv); + perror("start_tdeinit"); return 1; } #endif diff --git a/kinit/tests/klaunchertest.cpp b/kinit/tests/klaunchertest.cpp index ff1ae0fd1..46a4e5635 100644 --- a/kinit/tests/klaunchertest.cpp +++ b/kinit/tests/klaunchertest.cpp @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) { - KApplication::kdeinitExec("konsole"); + KApplication::tdeinitExec("konsole"); KApplication k(argc, argv, "klaunchertest"); diff --git a/kinit/wrapper.c b/kinit/wrapper.c index 15aa2bbf6..55577793b 100644 --- a/kinit/wrapper.c +++ b/kinit/wrapper.c @@ -181,13 +181,13 @@ static int openSocket() return -1; } - if (strlen(sock_file)+strlen(display)+strlen("/kdeinit_")+2 > MAX_SOCK_FILE) + if (strlen(sock_file)+strlen(display)+strlen("/tdeinit_")+2 > MAX_SOCK_FILE) { fprintf(stderr, "[trinity kinit] Warning: Socket name will be too long.\n"); free (display); return -1; } - strcat(sock_file, "/kdeinit_"); + strcat(sock_file, "/tdeinit_"); strcat(sock_file, display); free(display); @@ -330,24 +330,24 @@ int main(int argc, char **argv) p++; start = p; - if (strcmp(start, "kdeinit_wrapper") == 0) + if (strcmp(start, "tdeinit_wrapper") == 0) wrapper = 1; else if (strcmp(start, "kshell") == 0) ext_wrapper = 1; else if (strcmp(start, "kwrapper") == 0) kwrapper = 1; - else if (strcmp(start, "kdeinit_shutdown") == 0) + else if (strcmp(start, "tdeinit_shutdown") == 0) { if( argc > 1) { fprintf(stderr, "[trinity kinit] Usage: %s\n\n", start); - fprintf(stderr, "[trinity kinit] Shuts down kdeinit master process and terminates all processes spawned from it.\n"); + fprintf(stderr, "[trinity kinit] Shuts down tdeinit master process and terminates all processes spawned from it.\n"); exit( 255 ); } sock = openSocket(); if( sock < 0 ) { - fprintf( stderr, "[trinity kinit] Error: Can't contact kdeinit!\n" ); + fprintf( stderr, "[trinity kinit] Error: Can't contact tdeinit!\n" ); exit( 255 ); } header.cmd = LAUNCHER_TERMINATE_KDE; @@ -370,7 +370,7 @@ int main(int argc, char **argv) } sock = openSocket(); - if( sock < 0 ) /* couldn't contact kdeinit, start argv[ 0 ] directly */ + if( sock < 0 ) /* couldn't contact tdeinit, start argv[ 0 ] directly */ { execvp( argv[ 0 ], argv ); fprintf( stderr, "[trinity kinit] Error: Can't run %s !\n", argv[ 0 ] ); |