talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 102602650eb7603d1f3e0851ff5788fd9784ff09
parent 3167a0a3750303d686ad198167bbe3459d3a9a87
Author: Paul <paul@claws-mail.org>
Date:   Fri, 30 Dec 2022 10:25:44 +0000

remove obsolete /dev/mem_notify stuff

Diffstat:
Msrc/main.c | 57---------------------------------------------------------
1 file changed, 0 insertions(+), 57 deletions(-)

diff --git 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)