public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable
@ 2011-03-04 13:44 Alessio Ababilov
  2011-03-04 15:37 ` Pacho Ramos
  0 siblings, 1 reply; 2+ messages in thread
From: Alessio Ababilov @ 2011-03-04 13:44 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

It seems that development of EasyTAG is stopped, and so I send the patch 
to gentoo developers.

EasyTAG calls signal(SIGCHLD,SIG_IGN) to avoid zombies. It works fine,
but it leads to one problem.
If one calls 'Run Audio Player', the player's SIGCHLD signal handler is
inherited. So, when audacious calls system() in order to unpack its
archived skin, the archiver process ends silently (the wait() call in
system() function cannot hear that the child process has ended). The
audacious process assumes that there was an error and an unarchived skin
is used.
A possible solution is to set a handler for SIGCHLD in EasyTAG. The
handler is called when a child process ends and the latter doesn't
become a zombie.

Alessio Ababilov

[-- Attachment #2: easytag-2.1.6.patch --]
[-- Type: text/plain, Size: 1064 bytes --]

--- easytag-2.1.6/src/easytag.c.orig	2009-07-11 14:59:57.000000000 +0300
+++ easytag-2.1.6/src/easytag.c		2009-07-11 15:44:13.000000000 +0300
@@ -58,6 +58,8 @@
 
 #ifdef WIN32
 #   include "win32/win32dep.h"
+#else
+#   include <sys/wait.h>
 #endif
 
 #include "../pixmaps/EasyTAG_icon.xpm"
@@ -139,7 +141,21 @@
 void Quit_Recursion_Function_Button_Pressed (void);
 void Quit_Recursion_Window_Key_Press (GtkWidget *window, GdkEvent *event);
 
+#ifndef WIN32
+static void sigchld_handler(int signum)
+{
+	wait(NULL);
+}
 
+static void setup_sigchld()
+{
+	struct sigaction sa = {0};
+	sa.sa_handler = sigchld_handler;
+	sigemptyset(&sa.sa_mask);
+	sa.sa_flags = SA_RESTART; 
+	sigaction(SIGCHLD, &sa, NULL);
+}
+#endif
 
 /********
  * Main *
@@ -169,7 +185,7 @@
     signal(SIGFPE,Handle_Crash);
     signal(SIGSEGV,Handle_Crash);
     // Must handle this signal to avoid zombie of applications executed (ex: xmms)
-    signal(SIGCHLD,SIG_IGN); // Fix me! : can't run nautilus 1.0.6 with "Browse Directory With"
+    setup_sigchld();
 #endif
 
 #ifdef ENABLE_NLS


[-- Attachment #3: easytag-2.1.6-r5.ebuild --]
[-- Type: text/plain, Size: 1637 bytes --]

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/easytag/easytag-2.1.6-r4.ebuild,v 1.1 2010/07/29 23:16:04 ssuominen Exp $

EAPI=2
inherit eutils fdo-mime

DESCRIPTION="GTK+ utility for editing MP2, MP3, MP4, FLAC, Ogg and other media tags"
HOMEPAGE="http://easytag.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~hppa ~ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
IUSE="flac mp3 mp4 speex vorbis wavpack"

RDEPEND=">=x11-libs/gtk+-2.12:2
	mp3? ( >=media-libs/id3lib-3.8.3-r7
		media-libs/libid3tag )
	flac? ( media-libs/flac
		media-libs/libvorbis )
	mp4? ( >=media-libs/libmp4v2-1.9.0 )
	vorbis? ( media-libs/libvorbis )
	wavpack? ( media-sound/wavpack )
	speex? ( media-libs/speex
		media-libs/libvorbis )"
DEPEND="${RDEPEND}
	dev-util/pkgconfig
	sys-devel/gettext"

src_prepare() {
	epatch "${FILESDIR}"/${P}-desktop_entry.patch \
		"${FILESDIR}"/${P}-new_libmp4v2.patch \
		"${FILESDIR}"/${P}-cddb.patch \
		"${FILESDIR}"/${P}-load-from-txt.patch \
		"${FILESDIR}"/${P}-sigchld.patch
}

src_configure() {
	econf \
		$(use_enable mp3) \
		$(use_enable mp3 id3v23) \
		$(use_enable vorbis ogg) \
		$(use_enable flac) \
		$(use_enable mp4) \
		$(use_enable wavpack) \
		$(use_enable speex)
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc ChangeLog README THANKS TODO USERS-GUIDE
}

pkg_postinst() { fdo-mime_desktop_database_update; }
pkg_postrm() { fdo-mime_desktop_database_update; }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable
  2011-03-04 13:44 [gentoo-dev] EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable Alessio Ababilov
@ 2011-03-04 15:37 ` Pacho Ramos
  0 siblings, 0 replies; 2+ messages in thread
From: Pacho Ramos @ 2011-03-04 15:37 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

El vie, 04-03-2011 a las 15:44 +0200, Alessio Ababilov escribió:
> It seems that development of EasyTAG is stopped, and so I send the patch 
> to gentoo developers.
> 
> EasyTAG calls signal(SIGCHLD,SIG_IGN) to avoid zombies. It works fine,
> but it leads to one problem.
> If one calls 'Run Audio Player', the player's SIGCHLD signal handler is
> inherited. So, when audacious calls system() in order to unpack its
> archived skin, the archiver process ends silently (the wait() call in
> system() function cannot hear that the child process has ended). The
> audacious process assumes that there was an error and an unarchived skin
> is used.
> A possible solution is to set a handler for SIGCHLD in EasyTAG. The
> handler is called when a child process ends and the latter doesn't
> become a zombie.
> 
> Alessio Ababilov

What about opening a bug report at bugs.gentoo.org? 

Thanks :-)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-04 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 13:44 [gentoo-dev] EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable Alessio Ababilov
2011-03-04 15:37 ` Pacho Ramos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox