9
0
Fork 0

protect command: ignore -ENOSYS

Return success on -ENOSYS. (un)protecting a device which
is not protectable should not irritate users.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2009-10-12 09:27:47 +02:00
parent b71685e1f4
commit bf84eeb078
1 changed files with 3 additions and 2 deletions

View File

@ -117,7 +117,7 @@ static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[])
struct stat s;
int prot = 1;
unsigned long start = 0, size = ~0;
int ret = 0;
int ret = 0, err;
if (argc == 1) {
u_boot_cmd_usage(cmdtp);
@ -154,7 +154,8 @@ static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[])
goto out;
}
if(protect(fd, size, start, prot)) {
err = protect(fd, size, start, prot);
if (err && err != -ENOSYS) {
perror("protect");
ret = 1;
goto out;