Commit Graph

6 Commits (df3ad130d561c55bf7c48ad5cff1a79de144413e)

Author SHA1 Message Date
BangLang Huang 69da83d9f1 nvram: add help message for nvram magic not found
The program would failed if nvram magic not found
in specific partition.

Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
7 years ago
BangLang Huang c7e2a6fe92 nvram: improve argument check when program start
print help message when argument count is less
than 2.

Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
7 years ago
BangLang Huang 2a253e7cdb nvram: add usage() function
Merge the help message into a single function,
so that we can use it somewhere else.

Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
7 years ago
BangLang Huang 1948d8e08c nvram: fix memory leak
Fix memory leak on nvram_open() and nvram_open_rdonly().

For nvram_open(), the 'fd' should be closed on error, and
mmap_area should be unmap when nvram magic can not be found.

For nvram_open_rdonly(), the 'file' variable should free before
return. Once nvram_find_mtd() return successfully, it will allocate
memory to save mtd device string.

Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
7 years ago
Rafał Miłecki d372167491 nvram: fix displayed info about NVRAM size
Use actual partition size and content offset to calculate it.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 46260
9 years ago
John Crispin 4ebf19b48f packages: clean up the package folder
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37007
11 years ago