aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/exec-cmd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/exec-cmd.c b/src/exec-cmd.c
index 63db087..621acd1 100644
--- a/src/exec-cmd.c
+++ b/src/exec-cmd.c
@@ -48,14 +48,18 @@ int cmd_init(int argc, char *argv[])
// create .gpg-key in storage
FILE *filekey = fopen(GPGKEY_FILE, "w");
- if(!filekey)
- errprint_r(1, "%s\n", strerror(errno));
+ if(!filekey) {
+ print_error("Error: %s\n", strerror(errno));
+ return 1;
+ }
result = fputs(gpg_key, filekey);
- if(result == EOF)
- errprint_ptr(&retval, 1, "%s\n", strerror(errno));
- else
+ if(result == EOF) {
+ print_error("Error: %s\n", strerror(errno));
+ retval = 1;
+ } else {
printf("LockPassword initialized for %s\n", gpg_key);
+ }
fclose(filekey);
return retval;