Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37559300
en ru br
ALT Linux repositórios
S:2.15.0-alt1.2
5.0: 2.13.2-alt9
4.1: 2.13.2-alt8
4.0: 2.13.2-alt6
3.0: 2.13.1-alt1.1

Group :: Som
RPM: TiMidity++

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: TiMidity++-deb-don-t-crash-when-started-in-daemon-mode.patch
Download


From 45914850b9ce3b8a73d8d0bc30307f4247b5f0ed Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 26 Jun 2018 22:31:20 +0200
Subject: [PATCH 3/8] Don't crash when started in daemon mode
Bug-Debian: https://bugs.debian.org/545476
Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=501051
---
 TiMidity++/timidity/timidity.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff --git a/TiMidity++/timidity/timidity.c b/TiMidity++/timidity/timidity.c
index e92865c..c685ec9 100644
--- a/TiMidity++/timidity/timidity.c
+++ b/TiMidity++/timidity/timidity.c
@@ -5605,6 +5605,29 @@ MAIN_INTERFACE int timidity_post_load_configuration(void)
     }
 #endif
 
+    /* If we're going to fork for daemon mode, we need to fork now, as
+       certain output libraries (pulseaudio) become unhappy if initialized
+       before forking and then being used from the child. */
+    if (ctl->id_character == 'A' && (ctl->flags & CTLF_DAEMONIZE))
+    {
+	int pid = fork();
+	FILE *pidf;
+	switch (pid)
+	{
+	    case 0:		// child is the daemon
+		break;
+	    case -1:		// error status return
+		exit(7);
+	    default:		// no error, doing well
+		if ((pidf = fopen( "/var/run/timidity/timidity.pid", "w" )) != NULL )
+		{
+		    fprintf( pidf, "%d\n", pid );
+		    fclose( pidf );
+                }
+		exit(0);
+	}
+    }
+
     if(play_mode == &null_play_mode)
     {
 	char *output_id;
-- 
2.21.0
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009