summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-06-19 18:12:17 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-06-19 18:12:17 -0400
commitad83c56cbab054c36ec854bf9cc2e0be530fce72 (patch)
treeddb375223b6eeba38b1dcd415fe4ebb7c4e49110 /src/common
parent1fa2912aac2636bc6a4d8eda089c0e285f88d141 (diff)
parent7019354a75ca19ffd2e10f2e2b3dc89b480156bd (diff)
Merge commit 'jrollins/master'
Diffstat (limited to 'src/common')
-rw-r--r--src/common13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/common b/src/common
index 00ee7b0..e98f1bc 100644
--- a/src/common
+++ b/src/common
@@ -18,10 +18,17 @@ ETC="/etc/monkeysphere"
export ETC
CACHE="/var/cache/monkeysphere"
export CACHE
+ERR=0
+export ERR
########################################################################
### UTILITY FUNCTIONS
+error() {
+ log "$1"
+ ERR=${2:-'1'}
+}
+
failure() {
echo "$1" >&2
exit ${2:-'1'}
@@ -29,12 +36,12 @@ failure() {
# write output to stderr
log() {
- echo -n "ms: " 1>&2
- echo "$@" 1>&2
+ echo -n "ms: " >&2
+ echo "$@" >&2
}
loge() {
- echo "$@" 1>&2
+ echo "$@" >&2
}
# cut out all comments(#) and blank lines from standard input