From c00af771de936a8a42e8dee9775c5a15653d51ec Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Mon, 10 Nov 2025 04:04:05 +0300 Subject: [PATCH] twin/compton-tde: remove some dead code `WORK_AROUND_FGLRX` is not defined anywhere in the build system. And the code under the #ifdefs was broken for decades as `restartOnSigterm` is not declared, defined or used anywhere. Signed-off-by: Alexander Golubev --- twin/compton-tde/common.h | 2 +- twin/compton-tde/compton.c | 23 +---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h index d92396cdf..fdd1a5fb4 100644 --- a/twin/compton-tde/common.h +++ b/twin/compton-tde/common.h @@ -66,7 +66,7 @@ // TDE specific options // #define USE_ENV_HOME 1 #define WRITE_PID_FILE 1 -#define _TDE_COMP_MGR_VERSION_ 3.00 +#define _TDE_COMP_MGR_VERSION_ "3.00" #if defined(HAVE_LIBCONFIG_OLD_API) #define CONFIG_LIBCONFIG_LEGACY 1 #endif diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c index 2e76cb6b3..7ac0a7ad5 100644 --- a/twin/compton-tde/compton.c +++ b/twin/compton-tde/compton.c @@ -100,8 +100,6 @@ session_t *ps_g = NULL; struct sigaction usr_action; sigset_t block_mask; -int my_exit_code = 3; - void write_pid_file(pid_t pid) { #ifdef WRITE_PID_FILE @@ -155,29 +153,12 @@ void delete_pid_file() free(filename); filename = NULL; #endif - -#if WORK_AROUND_FGLRX - if ((my_exit_code == 3) && (restartOnSigterm)) { - printf("compton-tde lost connection to X server, restarting...\n"); fflush(stdout); - sleep(1); - char me[2048]; -#ifdef Q_OS_SOLARIS - int chars = readlink("/proc/self/path/a.out", me, sizeof(me)); -#else /* default */ - int chars = readlink("/proc/self/exe", me, sizeof(me)); -#endif /* self exe */ - me[chars] = 0; - me[2047] = 0; - execl(me, basename(me), (char*)NULL); - } -#endif } void handle_siguser (int sig) { int uidnum; if (sig == SIGTERM) { - my_exit_code=0; delete_pid_file(); exit(0); } @@ -195,9 +176,7 @@ void handle_siguser (int sig) printf("Setting compton-tde process uid to %d...\n", uidnum); fflush(stdout); #endif - my_exit_code=4; delete_pid_file(); - my_exit_code=3; setuid(uidnum); write_pid_file(getpid()); } @@ -6571,7 +6550,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) { case 'h': usage(0); break; - case 'v': fprintf (stderr, "%s v%-3.2f\n", argv[0], _TDE_COMP_MGR_VERSION_); my_exit_code=0; exit (0); + case 'v': fprintf (stderr, "%s v%s\n", argv[0], _TDE_COMP_MGR_VERSION_); exit (0); case 'd': case 'S': case 314: