summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2014-08-30 20:37:46 +0000
committerajacoutot <ajacoutot@openbsd.org>2014-08-30 20:37:46 +0000
commit662cbab60fab06bca1e01da5b5e334ca99ff650c (patch)
tree63838f64a9031c08f3c604e72a847130cc0b62ff
parentMake it possible to pass a specific error code to _rc_err(). (diff)
downloadwireguard-openbsd-662cbab60fab06bca1e01da5b5e334ca99ff650c.tar.xz
wireguard-openbsd-662cbab60fab06bca1e01da5b5e334ca99ff650c.zip
When a service is not available, return ENOENT.
Previous to this commit it was not possible to know whether a service existed without parsing the output of 'rcctl status' which is very expensive. req. by armani@ ok robert@ schwarze@
-rw-r--r--usr.sbin/rcctl/rcctl.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh
index 76bb1613c91..792b3c1503a 100644
--- a/usr.sbin/rcctl/rcctl.sh
+++ b/usr.sbin/rcctl/rcctl.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: rcctl.sh,v 1.34 2014/08/29 21:04:37 schwarze Exp $
+# $OpenBSD: rcctl.sh,v 1.35 2014/08/30 20:37:46 ajacoutot Exp $
#
# Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -267,7 +267,7 @@ flags=$*
if [ -n "$svc" ]; then
if ! svc_is_avail $svc; then
- _rc_err "${0##*/}: service $svc does not exist"
+ _rc_err "${0##*/}: service $svc does not exist" 2
fi
elif [ "$action" != "status" ]; then
usage