From 2bb1b1871e6bf8bb4daf471da7ada84b5f72d133 Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Tue, 11 Nov 2025 07:55:31 +0300
Subject: twin/compton: remove no longer used old pid-file functions

Bug: https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/issues/673
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 twin/compton-tde/common.h  |  1 -
 twin/compton-tde/compton.c | 57 ----------------------------------------------
 2 files changed, 58 deletions(-)

diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h
index 3ab731a9c..b3595fa29 100644
--- a/twin/compton-tde/common.h
+++ b/twin/compton-tde/common.h
@@ -65,7 +65,6 @@
 
 // TDE specific options
 // #define USE_ENV_HOME 1
-// #define WRITE_PID_FILE 1
 #define _TDE_COMP_MGR_VERSION_ "3.00"
 #if defined(HAVE_LIBCONFIG_OLD_API)
 #define CONFIG_LIBCONFIG_LEGACY 1
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c
index 137c94819..52711341b 100644
--- a/twin/compton-tde/compton.c
+++ b/twin/compton-tde/compton.c
@@ -95,63 +95,6 @@ const static char *background_props_str[] = {
 /// which could not have a pointer to current session passed in.
 session_t *ps_g = NULL;
 
-// === Execution control ===
-
-void write_pid_file(pid_t pid)
-{
-#ifdef WRITE_PID_FILE
-    const char *filename;
-    const char *pidfile = "compton-tde.pid";
-    char uidstr[sizeof(uid_t)*8+1];
-    sprintf(uidstr, "%d", getuid());
-    int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3;
-    filename = (char*)malloc(n*sizeof(char)+1);
-    memset(filename,0,n);
-    strcat(filename, P_tmpdir);
-    strcat(filename, "/.");
-    strcat(filename, uidstr);
-    strcat(filename, "-");
-    strcat(filename, pidfile);
-
-    /* now that we did all that by way of introduction...write the file! */
-    FILE *pFile;
-    char buffer[255];
-    sprintf(buffer, "%d", pid);
-    pFile = fopen(filename, "w");
-    if (pFile) {
-        fwrite(buffer,1,strlen(buffer), pFile);
-        fclose(pFile);
-    }
-
-    free(filename);
-    filename = NULL;
-#endif
-}
-
-void delete_pid_file()
-{
-#ifdef WRITE_PID_FILE
-    const char *filename;
-    const char *pidfile = "compton-tde.pid";
-    char uidstr[sizeof(uid_t)*8+1];
-    sprintf(uidstr, "%d", getuid());
-    int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3;
-    filename = (char*)malloc(n*sizeof(char)+1);
-    memset(filename,0,n);
-    strcat(filename, P_tmpdir);
-    strcat(filename, "/.");
-    strcat(filename, uidstr);
-    strcat(filename, "-");
-    strcat(filename, pidfile);
-
-    /* now that we did all that by way of introduction...delete the file! */
-    unlink(filename);
-
-    free(filename);
-    filename = NULL;
-#endif
-}
-
 // === Fading ===
 
 /**
-- 
cgit v1.2.3

