diff --git a/helpers/DATA/pcmanfm/pcmanfm-0201-main-set-the-GIOChannel-encoding-to-binary.patch b/helpers/DATA/pcmanfm/pcmanfm-0201-main-set-the-GIOChannel-encoding-to-binary.patch new file mode 100644 index 0000000000000000000000000000000000000000..7a2cd91b7887549a6149f211bbaf1f43a81bbb4e --- /dev/null +++ b/helpers/DATA/pcmanfm/pcmanfm-0201-main-set-the-GIOChannel-encoding-to-binary.patch @@ -0,0 +1,31 @@ +From ec3c00ed4c5130fdc8a83b84b587da8457e067f1 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA <mtasaka@fedoraproject.org> +Date: Sun, 22 Mar 2020 16:46:48 +0900 +Subject: [PATCH] main: set the GIOChannel encoding to binary + +https://developer.gnome.org/glib/stable/glib-IO-Channels.html#g-io-channel-set-encoding +says the default encoding is UTF-8, and setting encoding to NULL is safe +use with binary data. + +Actually without setting encoding to NULL, on Fedora 32, trying to terminate pcmanfm with +Ctrl-C (SIGINT) causes pcmanfm hang at g_io_channel_read_chars() in on_unix_signal(), +and this is now causing system reboot delayed for 90 seconds with systemd. +--- + src/pcmanfm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/pcmanfm.c b/src/pcmanfm.c +index 9be80f7..c0fe84f 100644 +--- a/src/pcmanfm.c ++++ b/src/pcmanfm.c +@@ -239,6 +239,7 @@ int main(int argc, char** argv) + { + GIOChannel* ch = g_io_channel_unix_new(signal_pipe[0]); + g_io_add_watch(ch, G_IO_IN|G_IO_PRI, (GIOFunc)on_unix_signal, NULL); ++ g_io_channel_set_encoding(ch, NULL, NULL); + g_io_channel_unref(ch); + + /* intercept signals */ +-- +2.26.0.rc2 + diff --git a/helpers/make-pcmanfm b/helpers/make-pcmanfm new file mode 100644 index 0000000000000000000000000000000000000000..02ca96657c76c8212098c2cdd2a2cc14ab986637 --- /dev/null +++ b/helpers/make-pcmanfm @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Copyright (C) 2021 Luis Guzman <ark@switnet.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +VERSION=1 + +. ./config + +patch -p1 < $DATA/pcmanfm-0201-main-set-the-GIOChannel-encoding-to-binary.patch + +changelog "Fix hanging issue LP#1878625, remove after 1.3.2-1." + +compile