safe

Password protected secret keeper
git clone git://git.z3bra.org/safe.git
Log | Files | Refs | README | LICENSE

commit 8b0d9811b499d09eca3f5718cd88844af2e9ecd3
parent cb46ec01b637619484afb68b08a3c715f86d5d6e
Author: Willy Goiffon <dev@z3bra.org>
Date:   Mon,  3 Jun 2019 17:38:34 +0200

Remove err() call in favor of return in getkey()

Diffstat:
safe.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/safe.c b/safe.c @@ -274,12 +274,11 @@ getkey(struct safe *s, char *path) strcpy(addr.sun_path, path); if ((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) - err(1, "socket %s", path); + return -1; if (connect(sfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) - err(1, "connect %s", path); + return -1; - xwrite(sfd, s->salt, sizeof(s->salt)); xread(sfd, s->key, sizeof(s->key), NULL); return 0;