[Commits] [SCM] claws branch, master, updated. 4.1.1-29-g102602650

paul at claws-mail.org paul at claws-mail.org
Fri Dec 30 10:25:57 UTC 2022


The branch, master has been updated
       via  102602650eb7603d1f3e0851ff5788fd9784ff09 (commit)
      from  3167a0a3750303d686ad198167bbe3459d3a9a87 (commit)

Summary of changes:
 src/main.c | 57 ---------------------------------------------------------
 1 file changed, 57 deletions(-)


- Log -----------------------------------------------------------------
commit 102602650eb7603d1f3e0851ff5788fd9784ff09
Author: Paul <paul at claws-mail.org>
Date:   Fri Dec 30 10:25:44 2022 +0000

    remove obsolete /dev/mem_notify stuff

diff --git a/src/main.c b/src/main.c
index a9351b052..932da3ae0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -235,9 +235,6 @@ static void initial_processing		(FolderItem *item, gpointer data);
 static void quit_signal_handler         (int sig);
 #endif
 static void install_basic_sighandlers   (void);
-#if (defined linux && defined SIGIO)
-static void install_memory_sighandler   (void);
-#endif
 static void exit_claws			(MainWindow *mainwin);
 
 #ifdef HAVE_NETWORKMANAGER_SUPPORT
@@ -1120,9 +1117,6 @@ int main(int argc, char *argv[])
 	crash_install_handlers();
 #endif
 	install_basic_sighandlers();
-#if (defined linux && defined SIGIO)
-	install_memory_sighandler();
-#endif
 
 	if (cmd.status || cmd.status_full || cmd.search ||
 		cmd.statistics || cmd.reset_statistics || 
@@ -2973,57 +2967,6 @@ static void install_basic_sighandlers()
 #endif /* !G_OS_WIN32 */
 }
 
-#if (defined linux && defined SIGIO)
-static int mem_notify_fd = 0;
-
-static gboolean clean_caches(gpointer unused)
-{
-	if (static_mainwindow && static_mainwindow->lock_count > 0)
-		return TRUE;
-	debug_print("/dev/mem_notify: callback: Freeing some memory now!\n");
-	folder_clean_cache_memory_force();
-	return FALSE;
-}
-
-static void memory_signal_handler(int sig)
-{
-	debug_print("/dev/mem_notify: Kernel says we should free up some memory!\n");
-	g_timeout_add(10, clean_caches, NULL); 
-}
-
-static void install_memory_sighandler()
-{
-	sigset_t    mask;
-	struct sigaction act;
-	int flags;
-
-	mem_notify_fd = g_open("/dev/mem_notify", O_RDONLY|O_NONBLOCK, 0);
-	if (mem_notify_fd == -1) {
-		debug_print("/dev/mem_notify not available (%s)\n", 
-			g_strerror(errno));
-		return;
-	}
-	
-	fcntl(mem_notify_fd, F_SETOWN, getpid());
-	flags = fcntl(mem_notify_fd, F_GETFL);
-	fcntl(mem_notify_fd, flags|FASYNC);
-
-	sigemptyset(&mask);
-
-	sigaddset(&mask, SIGIO);
-
-	act.sa_handler = memory_signal_handler;
-	act.sa_mask    = mask;
-	act.sa_flags   = 0;
-
-	sigaction(SIGIO, &act, 0);
-
-	sigprocmask(SIG_UNBLOCK, &mask, 0);
-
-	debug_print("/dev/mem_notify: installed handler\n");
-}
-#endif /* linux && SIGIO */
-
 #ifdef HAVE_NETWORKMANAGER_SUPPORT
 static void networkmanager_state_change_cb(DBusGProxy *proxy, gchar *dev,
 					 gpointer data)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list