diff options
author | Tom Rini <trini@konsulko.com> | 2021-01-11 13:55:03 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-11 13:55:03 -0500 |
commit | d71be1990218957b9f05dbf13a72859a2abe06d7 (patch) | |
tree | 99858dc9988f7f7b4c0ab1d8d45738e3abdf38c8 /cmd/nvedit.c | |
parent | c4fddedc48f336eabc4ce3f74940e6aa372de18c (diff) | |
parent | bc0b99bd8b19599f670f42401de655fa9b44cd94 (diff) | |
download | u-boot-d71be1990218957b9f05dbf13a72859a2abe06d7.tar.gz |
Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'cmd/nvedit.c')
-rw-r--r-- | cmd/nvedit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 7fce723800..d0d2eca904 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -266,7 +266,9 @@ static int _do_env_set(int flag, int argc, char *const argv[], int env_flag) /* Delete only ? */ if (argc < 3 || argv[2] == NULL) { int rc = hdelete_r(name, &env_htab, env_flag); - return !rc; + + /* If the variable didn't exist, don't report an error */ + return rc && rc != -ENOENT ? 1 : 0; } /* @@ -895,7 +897,7 @@ static int do_env_delete(struct cmd_tbl *cmdtp, int flag, while (--argc > 0) { char *name = *++argv; - if (!hdelete_r(name, &env_htab, env_flag)) + if (hdelete_r(name, &env_htab, env_flag)) ret = 1; } |