diff options
author | Zhihao Cheng <chengzhihao1@huawei.com> | 2024-11-11 16:36:34 +0800 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2024-11-11 10:32:45 +0100 |
commit | bc85302b02f8a1af351d05050f9de8a54c68ba09 (patch) | |
tree | e1437e4509aa7184ca76e9db2213e2630b3965e6 /ubifs-utils/common/lpt.c | |
parent | 03ec75b9e6ad4cb372f86d1581c2b1b2ef987c72 (diff) |
ubifs-utils: Define PROGRAM_NAME as variable
PROGRAM_NAME is defined as a const string "mkfs.ubifs", which won't be
suitable for fsck.ubifs. Add 'program_name' member in ubifs_info
structure, define PROGRAM_NAME as ubifs_info.program_name. Then, error
messages will display right program name if fsck.ubifs is supported.
Besides, add 'program_type' member in ubifs_info structure to identify
which current program type is, without comparing program name.
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/common/lpt.c')
-rw-r--r-- | ubifs-utils/common/lpt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ubifs-utils/common/lpt.c b/ubifs-utils/common/lpt.c index 23ffe7f..746fc7d 100644 --- a/ubifs-utils/common/lpt.c +++ b/ubifs-utils/common/lpt.c @@ -24,14 +24,17 @@ #include <openssl/evp.h> #endif -#define PROGRAM_NAME "mkfs.ubifs" -#include "common.h" #include "lpt.h" #include "defs.h" #include "ubifs.h" #include "crc16.h" #include "sign.h" +/* common.h requires the PROGRAM_NAME macro */ +extern struct ubifs_info info_; +#define PROGRAM_NAME (info_.program_name) +#include "common.h" + /** * do_calc_lpt_geom - calculate sizes for the LPT area. * @c: the UBIFS file-system description object |