package

simple and robust package manager
Log | Files | Refs | README

commit 3d5f0823b3d6b56bedb89b4b7260bb242f8bfd8f
parent 062322e033a54c85e362d4d91e27cc1a71d60656
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 13 Jan 2019 01:46:34 +0100

fix setenv return value

Diffstat:
Menv.h | 4++--
Mpack.c | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/env.h b/env.h @@ -4,7 +4,7 @@ #include <stdlib.h> #define env_get(name) getenv(name) -#define env_set(name, value) setenv(name, value, 1) -#define env_unset(name, value) unsetenv(name, value, 1) +#define env_set(name, value) !setenv(name, value, 1) +#define env_unset(name, value) !unsetenv(name, value, 1) #endif diff --git a/pack.c b/pack.c @@ -424,7 +424,7 @@ pack_env(pack *p, const char *def, const char *out) errno = 0; fd = pack_opendepfile(p, def); - if (fd == -1) { ret = (errno != ENOTDIR && errno != ENOENT); goto err; } + if (fd == -1) { ret = (errno == ENOTDIR || errno == ENOENT); goto err; } buffer_init(&b, &read, fd, buf, sizeof buf); stralloc_init(&line);