aboutsummaryrefslogtreecommitdiff
path: root/flash_otp_lock.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-09-26 14:48:51 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-27 09:31:10 +0300
commite960f7eb17f8d72f00364e9fc9f9a27b5563e318 (patch)
tree9c64699e742b6d220539a8827e29a662d9629fb7 /flash_otp_lock.c
parent6edaa0c971aab663cda573ded5013b3b998ee5d4 (diff)
mtd-utils: standardize PROGRAM_NAME
Make sure all the utils define PROGRAM_NAME and do so at the start of the file so that sub-headers may assume it exists. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'flash_otp_lock.c')
-rw-r--r--flash_otp_lock.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/flash_otp_lock.c b/flash_otp_lock.c
index d0e06cd..cc8759e 100644
--- a/flash_otp_lock.c
+++ b/flash_otp_lock.c
@@ -2,6 +2,8 @@
* flash_otp_lock.c -- lock area of One-Time-Program data
*/
+#define PROGRAM_NAME "flash_otp_lock"
+
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
@@ -18,7 +20,7 @@ int main(int argc,char *argv[])
char *p, buf[8];
if (argc != 5 || strcmp(argv[1], "-u")) {
- fprintf(stderr, "Usage: %s -u <device> <offset> <size>\n", argv[0]);
+ fprintf(stderr, "Usage: %s -u <device> <offset> <size>\n", PROGRAM_NAME);
fprintf(stderr, "offset and size must match on OTP region boundaries\n");
fprintf(stderr, "CAUTION! ONCE LOCKED, OTP REGIONS CAN'T BE UNLOCKED!\n");
return EINVAL;
@@ -39,13 +41,13 @@ int main(int argc,char *argv[])
offset = strtoul(argv[3], &p, 0);
if (argv[3][0] == 0 || *p != 0) {
- fprintf(stderr, "%s: bad offset value\n", argv[0]);
+ fprintf(stderr, "%s: bad offset value\n", PROGRAM_NAME);
return ERANGE;
}
size = strtoul(argv[4], &p, 0);
if (argv[4][0] == 0 || *p != 0) {
- fprintf(stderr, "%s: bad size value\n", argv[0]);
+ fprintf(stderr, "%s: bad size value\n", PROGRAM_NAME);
return ERANGE;
}