aboutsummaryrefslogtreecommitdiffstats
path: root/src/redo.c
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2014-11-16 19:19:59 +0100
committerTharre <tharre3@gmail.com>2014-11-16 19:19:59 +0100
commitdf9bc5b9d048c7ecb96838123e39d5bc7c23aa18 (patch)
tree5432d5cc4a0e5a7550f7bae00964f09cb68b6361 /src/redo.c
parentb4c1b2145d6a0b1ec4219847dc26877046f84e8b (diff)
downloadredo-df9bc5b9d048c7ecb96838123e39d5bc7c23aa18.tar.gz
redo-df9bc5b9d048c7ecb96838123e39d5bc7c23aa18.tar.xz
redo-df9bc5b9d048c7ecb96838123e39d5bc7c23aa18.zip
Refactor error handling system by using die()
Defined error messages have also been replaced with string literals.
Diffstat (limited to 'src/redo.c')
-rw-r--r--src/redo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/redo.c b/src/redo.c
index 53b5e43..a62f1a6 100644
--- a/src/redo.c
+++ b/src/redo.c
@@ -34,9 +34,9 @@ void prepare_env() {
/* set REDO_ROOT */
char *cwd = getcwd(NULL, 0);
if (!cwd)
- fatal("redo: failed to obtain cwd");
+ diem("redo: failed to obtain cwd");
if (setenv("REDO_ROOT", cwd, 0))
- fatal("redo: failed to setenv REDO_ROOT to %s", cwd);
+ diem("redo: failed to setenv REDO_ROOT to %s", cwd);
free(cwd);
/* set REDO_MAGIC */
@@ -44,7 +44,7 @@ void prepare_env() {
char magic_str[digits(UINT_MAX) + 1];
sprintf(magic_str, "%u", rand());
if (setenv("REDO_MAGIC", magic_str, 0))
- fatal("setenv()");
+ diem("redo: failed to setenv() REDO_MAGIC to %s", magic_str);
}
int main(int argc, char *argv[]) {