# HG changeset patch # User Franz Glasner # Date 1727464894 -7200 # Node ID 4ee9a8042f4afc8b496ddd3423477f6266bc0727 # Parent cd4aea87dbfadbc7290322292d78746b6b510267 common.subr: _get_jail_from_path() now just returns when the jail is dying. But it prints the name of the jail if it is yet dying. Real error reporting must not consistently be done in the caller. diff -r cd4aea87dbfa -r 4ee9a8042f4a share/local-bsdtools/common.subr --- a/share/local-bsdtools/common.subr Fri Sep 27 20:35:34 2024 +0200 +++ b/share/local-bsdtools/common.subr Fri Sep 27 21:21:34 2024 +0200 @@ -303,11 +303,12 @@ #: Search for a running jail where it's "path" points to a given location #: #: Args: -#: $1: the location to search for +#: $1 (str): The location to search for. #: #: Output (stdout): #: The name if the jail with a "path" that is equal to the input param. #: Nothing if a jail is not found. +#: The name is written when the jail is running and/or a dying. #: #: Return: #: 0: if a running jail is found @@ -353,7 +354,8 @@ while IFS=$'\t' read -r _dying _name _path ; do if [ "${_path}" = "${_location}" ]; then if [ "${_dying}" != "false" ]; then - echo "Jail \`${_name}' is currently dying" 1>&2 + # Dying + printf '%s' "${_name}" return 2 fi printf '%s' "${_name}" @@ -368,7 +370,8 @@ while IFS=' '$'\t' read -r _name _dying _path ; do if [ "${_path}" = "${_location}" ]; then if [ "${_dying}" != "false" ]; then - echo "Jail \`${_name}' is currently dying" 1>&2 + # Dying + printf '%s' "${_name}" return 2 fi printf '%s' "${_name}"