Răsfoiți Sursa

App-Control-Funktion zum Beenden eines Prozesses im Zombie-State hinzugefügt.

Rind 4 ani în urmă
părinte
comite
5718f16d90
6 a modificat fișierele cu 45 adăugiri și 5 ștergeri
  1. 15 2
      README.md
  2. 1 1
      gfaipc.pro
  3. 0 2
      gfasysinfo/src/main.cpp
  4. 23 0
      src/appctrl.cpp
  5. 2 0
      src/appctrl.h
  6. 4 0
      src/gfaipc.h

+ 15 - 2
README.md

@@ -1,7 +1,7 @@
 ## libgfaipc  
 
 ***Version:***  
-libgfaipc.so.1.2.0  
+libgfaipc.so.1.3.0  
 
 ***SO-Name:***  
 libgfaipc.so.1
@@ -33,9 +33,22 @@ gfa/shm.h, gfa/mutex.h, gfa/sema.h, gfa/procmem.h
 
 ---
 
+**Installation:**
+
+* Wird durch die [GfaLibs-Installers](https://gogs.reru.org/GfA/GfaLibs-Installers) mitinstalliert.
+
+---
+
+**History:**
+
+* **1.3.0**<br>
+	App-Control-Funktion zum Beenden eines Prozesses im Zombie-State hinzugefügt.
+
+---
+
 ## gfasysinfo
 
-Prozess zur Bereitstellung von Systeminformationen. Arbeitet eng mit libgfaipc zusammen.  
+Prozess zur Bereitstellung von Systeminformationen. Arbeitet eng mit ***libgfaipc*** zusammen.  
 Versorgt die Bibliothek mit Informationen über CPU-Auslastung, Speichernutzung, Hotplug-Events u. ä., die von anderen Prozessen mittels Bibliothek genutzt werden können.
 
 ***Abhängikeiten:***  

+ 1 - 1
gfaipc.pro

@@ -1,5 +1,5 @@
 TEMPLATE = lib
-VERSION = 1.2
+VERSION = 1.3
 CONFIG -= qt app_bundle
 CONFIG += c++11 shared thread
 

+ 0 - 2
gfasysinfo/src/main.cpp

@@ -1,10 +1,8 @@
 #include <stdio.h>
-#include <stdio.h>
 #include <unistd.h>
 #include <string.h>
 #include <string>
 #include <vector>
-//#include <regex>
 #include <map>
 #include <ext/stdio_filebuf.h>
 #include <iostream>

+ 23 - 0
src/appctrl.cpp

@@ -842,6 +842,21 @@ bool CAppCtrl::GetBootFromEmmc(bool *pbBootFromEmmc)
 	return false;
 }
 
+bool CAppCtrl::KillApp(appid_t nAppID)
+{
+	if(m_hShm && _IS_VALID_APP_ID(nAppID))
+	{
+		int nIndex = SlotIndexFromAppID(nAppID);
+		const APP_CTRL_PROCESS &proc = m_pAppCtrl->proc[nIndex];
+		if((proc.nAppID == nAppID) && (proc.pid > 0))
+		{
+			return !kill(proc.pid, SIGTERM);
+		}
+	}
+
+	return false;
+}
+
 /////////////////////////////////////////////////////////////////////////////
 
 bool CAppCtrl::CreateSysInfo(void)
@@ -1556,6 +1571,14 @@ bool GfaIpcAppCtrlGetBootFromEmmc(HAPPCTRL hAC, bool *pbBootFromEmmc)
 	return false;
 }
 
+bool GfaIpcAppCtrlKillApp(HAPPCTRL hAC, appid_t nAppID)
+{
+	CAppCtrl *p = reinterpret_cast<CAppCtrl*>(hAC);
+	if(p)
+		return p->KillApp(nAppID);
+	return false;
+}
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////

+ 2 - 0
src/appctrl.h

@@ -166,6 +166,8 @@ public:
 	int GetNextMountRemoved(LPGFA_SYSINFO_PARTITION pPart);
 	
 	bool GetBootFromEmmc(bool *pbBootFromEmmc);
+	
+	bool KillApp(appid_t nAppID);
 
 private:
 	int SlotIndexFromAppID(appid_t nAppID);

+ 4 - 0
src/gfaipc.h

@@ -334,6 +334,10 @@ int				GfaIpcAppCtrlGetNextMountRemoved	(HAPPCTRL hAC, LPGFA_SYSINFO_PARTITION p
 
 bool			GfaIpcAppCtrlGetBootFromEmmc		(HAPPCTRL hAC, bool *pbBootFromEmmc);
 
+/////////////////////////////////////////////////////////////////////////////
+
+bool			GfaIpcAppCtrlKillApp				(HAPPCTRL hAC, appid_t nAppID);
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////