Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Alessio Ababilov <ilovegnulinux@...>
Subject: EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable
Date: Fri, 04 Mar 2011 15:44:52 +0200
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
--- 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

# 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; }
Replies:
Re: EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable
-- Pacho Ramos
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Last rites: www-client/chromium-bin
Next by thread:
Re: EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable
Previous by date:
Last rites: www-client/chromium-bin
Next by date:
Re: EasyTAG 2.1.6 Handle SIGCHLD to make audacious archived skins workable


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.