FreeBSD Bugzilla – Attachment 115403 Details for
Bug 157173
audio/musicpd: wait --kill to finish (FreeBSD-only)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
musicpd_2-pwait.patch
musicpd_2-pwait.patch (text/plain), 1.71 KB, created by
lichray
on 2011-05-19 09:10:10 UTC
(
hide
)
Description:
musicpd_2-pwait.patch
Filename:
MIME Type:
Creator:
lichray
Created:
2011-05-19 09:10:10 UTC
Size:
1.71 KB
patch
obsolete
>diff -ruN --exclude=CVS /usr/ports/audio/musicpd.orig/Makefile /usr/ports/audio/musicpd/Makefile >--- /usr/ports/audio/musicpd.orig/Makefile 2011-05-16 08:32:35.000000000 -0500 >+++ /usr/ports/audio/musicpd/Makefile 2011-05-19 01:11:44.814689280 -0500 >@@ -7,7 +7,7 @@ > > PORTNAME= musicpd > PORTVERSION= 0.16.2 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= audio ipv6 > MASTER_SITES= SF/${PORTNAME}/mpd/${PORTVERSION} > DISTNAME= mpd-${PORTVERSION} >diff -ruN --exclude=CVS /usr/ports/audio/musicpd.orig/files/patch-src_daemon.c /usr/ports/audio/musicpd/files/patch-src_daemon.c >--- /usr/ports/audio/musicpd.orig/files/patch-src_daemon.c 1969-12-31 18:00:00.000000000 -0600 >+++ /usr/ports/audio/musicpd/files/patch-src_daemon.c 2011-05-19 01:11:29.428807721 -0500 >@@ -0,0 +1,45 @@ >+--- src/daemon.c.orig 2011-05-19 00:57:23.647296897 -0500 >++++ src/daemon.c 2011-05-19 01:10:01.251176681 -0500 >+@@ -37,6 +37,11 @@ >+ #include <grp.h> >+ #endif >+ >++#ifdef __FreeBSD__ >++#include <sys/event.h> >++#include <sys/wait.h> >++#endif >++ >+ #undef G_LOG_DOMAIN >+ #define G_LOG_DOMAIN "daemon" >+ >+@@ -58,6 +63,18 @@ static char *pidfile; >+ static bool had_group = false; >+ >+ >++int pwait(pid_t pid) >++{ >++ int kq = kqueue(); >++ struct kevent kev; >++ EV_SET(&kev, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL); >++ if (kevent(kq, &kev, 1, NULL, 0, NULL) == -1) >++ return -1; >++ if (kevent(kq, NULL, 0, &kev, 1, NULL)) >++ return WEXITSTATUS(kev.data); >++ return 1; >++} >++ >+ void >+ daemonize_kill(void) >+ { >+@@ -79,7 +96,11 @@ daemonize_kill(void) >+ fclose(fp); >+ >+ ret = kill(pid, SIGTERM); >++#ifdef __FreeBSD__ >++ if (ret < 0 || pwait(pid) < 0) >++#else >+ if (ret < 0) >++#endif >+ MPD_ERROR("unable to kill proccess %i: %s", >+ pid, g_strerror(errno)); >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 157173
: 115403 |
115404
|
115405
|
115406