aboutsummaryrefslogtreecommitdiff
path: root/audio/rplay
diff options
context:
space:
mode:
authorNorikatsu Shigemura <nork@FreeBSD.org>2003-01-30 17:30:49 +0000
committerNorikatsu Shigemura <nork@FreeBSD.org>2003-01-30 17:30:49 +0000
commitf865228a086451289ebc90a488cc8e2720695ea8 (patch)
treea076b0da635e6e21f0ef48643d5be4e562c351c2 /audio/rplay
parentc65c37a41b47a17452a8daf3469a662b2f17c08a (diff)
downloadports-f865228a086451289ebc90a488cc8e2720695ea8.tar.gz
ports-f865228a086451289ebc90a488cc8e2720695ea8.zip
o use daemon(3) instead of just fork(2) when daemonize.
o make rc.d script more modern, accordingly. o Bump PORTREVISION. PR: ports/27875 Submitted by: Takanori Saneto <sanewo@ba2.so-net.ne.jp>
Notes
Notes: svn path=/head/; revision=74294
Diffstat (limited to 'audio/rplay')
-rw-r--r--audio/rplay/Makefile1
-rw-r--r--audio/rplay/files/patch-rplayd::rplayd.c16
-rw-r--r--audio/rplay/files/rplayd.sh5
3 files changed, 20 insertions, 2 deletions
diff --git a/audio/rplay/Makefile b/audio/rplay/Makefile
index 5a69a2331140..d4acef3e8b13 100644
--- a/audio/rplay/Makefile
+++ b/audio/rplay/Makefile
@@ -7,6 +7,7 @@
PORTNAME= rplay
PORTVERSION= 3.3.2
+PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= http://rplay.doit.org/dist/
diff --git a/audio/rplay/files/patch-rplayd::rplayd.c b/audio/rplay/files/patch-rplayd::rplayd.c
new file mode 100644
index 000000000000..e764578164ab
--- /dev/null
+++ b/audio/rplay/files/patch-rplayd::rplayd.c
@@ -0,0 +1,16 @@
+--- rplayd/rplayd.c.orig Wed Mar 10 16:58:04 1999
++++ rplayd/rplayd.c Fri Jan 31 02:12:40 2003
+@@ -421,10 +421,9 @@
+ /* Fork */
+ if (do_fork)
+ {
+- int pid = fork();
+- if (pid != 0)
+- {
+- exit(0);
++ if (daemon(1, 1) < 0) {
++ report(REPORT_ERROR, "daemon: %s\n", sys_err_str(errno));
++ done(1);
+ }
+ }
+
diff --git a/audio/rplay/files/rplayd.sh b/audio/rplay/files/rplayd.sh
index ffce002a43eb..b9fbae452225 100644
--- a/audio/rplay/files/rplayd.sh
+++ b/audio/rplay/files/rplayd.sh
@@ -1,19 +1,20 @@
#!/bin/sh
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
case "$1" in
start)
- [ -x ${PREFIX}/sbin/rplayd ] && ( ${PREFIX}/sbin/rplayd & ) && echo -n ' rplayd'
+ [ -x ${PREFIX}/sbin/rplayd ] && ${PREFIX}/sbin/rplayd && echo -n ' rplayd'
;;
stop)
killall rplayd && echo -n ' rplayd'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
+ exit 64
;;
esac