aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
authorMark Allen <[email protected]>2016-06-13 14:28:47 -0500
committerGitHub <[email protected]>2016-06-13 14:28:47 -0500
commitbcf8d62371d45ab059148a953cba26f5860a8fbc (patch)
tree0eb7b36e9aeb735d107cbdb9b43d165623f7b4eb /kerl
parentbb22e63bb6b018b571dfd974b0b02b60dcb8a58d (diff)
parentca96e227e1dc55c3a4f7b930e6d766f048efb2b8 (diff)
downloadkerl-bcf8d62371d45ab059148a953cba26f5860a8fbc.tar.gz
kerl-bcf8d62371d45ab059148a953cba26f5860a8fbc.tar.bz2
kerl-bcf8d62371d45ab059148a953cba26f5860a8fbc.zip
Merge pull request #142 from kerl/gh141
Do not assume writes to list_add/remove succeed
Diffstat (limited to 'kerl')
-rwxr-xr-xkerl6
1 files changed, 3 insertions, 3 deletions
diff --git a/kerl b/kerl
index a1ea41b..2fec388 100755
--- a/kerl
+++ b/kerl
@@ -892,16 +892,16 @@ list_add()
return 1
fi
done < "$KERL_BASE_DIR/otp_$1"
- echo "$2" >> "$KERL_BASE_DIR/otp_$1"
+ echo "$2" >> "$KERL_BASE_DIR/otp_$1" || exit 1
else
- echo "$2" > "$KERL_BASE_DIR/otp_$1"
+ echo "$2" > "$KERL_BASE_DIR/otp_$1" || exit 1
fi
}
list_remove()
{
if [ -f "$KERL_BASE_DIR/otp_$1" ]; then
- sed $SED_OPT -i -e "/^.*$2$/d" "$KERL_BASE_DIR/otp_$1"
+ sed $SED_OPT -i -e "/^.*$2$/d" "$KERL_BASE_DIR/otp_$1" || exit 1
fi
}