aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lpass.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lpass.c b/src/lpass.c
index 70b4b80..c6a42cf 100644
--- a/src/lpass.c
+++ b/src/lpass.c
@@ -61,15 +61,14 @@ static struct cmd_struct *get_cmd(const char *name)
static int goto_maindir()
{
- int result;
char *rootdir = xstrcat(getenv("HOME"), LOCKPASS_DIR, "/");
int retval = chdir(rootdir);
if(retval) // failed
{
if(errno == ENOENT) {
// create main directory:
- result = mkdir(rootdir, S_IRWXU);
- if(result && errno != EEXIST) {
+ retval = mkdir(rootdir, S_IRWXU);
+ if(retval && errno != EEXIST) {
print_error("Error: %s\n", strerror(errno));
} else { // try again:
retval = chdir(rootdir);