summaryrefslogtreecommitdiffstats
path: root/src/hci/commands/nvo_cmd.c
diff options
context:
space:
mode:
authorMichael Brown2006-12-20 05:20:13 +0100
committerMichael Brown2006-12-20 05:20:13 +0100
commit35edecac34e129ea075e00d021fc6e786fa20777 (patch)
treeeec108ce34d9786c0cabf35f510d98ac7cb5f1dd /src/hci/commands/nvo_cmd.c
parentAdded messages for some of the most common errors (diff)
downloadipxe-35edecac34e129ea075e00d021fc6e786fa20777.tar.gz
ipxe-35edecac34e129ea075e00d021fc6e786fa20777.tar.xz
ipxe-35edecac34e129ea075e00d021fc6e786fa20777.zip
Move {show,set,clear}_setting() to {show,set,clear}_named_setting().
Introduce new {show,set,clear}_setting() that take a struct setting * rather than a const char *. set_setting() handles calling clear_setting() when appropriate, so that individual setting types don't have to check for empty strings.
Diffstat (limited to 'src/hci/commands/nvo_cmd.c')
-rw-r--r--src/hci/commands/nvo_cmd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/hci/commands/nvo_cmd.c b/src/hci/commands/nvo_cmd.c
index 357d636a..bbc9a749 100644
--- a/src/hci/commands/nvo_cmd.c
+++ b/src/hci/commands/nvo_cmd.c
@@ -27,8 +27,8 @@ static int show_exec ( int argc, char **argv ) {
}
dummy_context.options = ugly_nvo_hack->options;
- if ( ( rc = show_setting ( &dummy_context, argv[1], buf,
- sizeof ( buf ) ) ) != 0 ) {
+ if ( ( rc = show_named_setting ( &dummy_context, argv[1], buf,
+ sizeof ( buf ) ) ) != 0 ) {
printf ( "Could not find \"%s\": %s\n",
argv[1], strerror ( -rc ) );
return 1;
@@ -59,7 +59,8 @@ static int set_exec ( int argc, char **argv ) {
}
dummy_context.options = ugly_nvo_hack->options;
- if ( ( rc = set_setting ( &dummy_context, argv[1], argv[2] ) ) != 0 ) {
+ if ( ( rc = set_named_setting ( &dummy_context, argv[1],
+ argv[2] ) ) != 0 ) {
printf ( "Could not set \"%s\"=\"%s\": %s\n",
argv[1], argv[2], strerror ( -rc ) );
return 1;
@@ -94,7 +95,7 @@ static int clear_exec ( int argc, char **argv ) {
}
dummy_context.options = ugly_nvo_hack->options;
- if ( ( rc = clear_setting ( &dummy_context, argv[1] ) ) != 0 ) {
+ if ( ( rc = clear_named_setting ( &dummy_context, argv[1] ) ) != 0 ) {
printf ( "Could not clear \"%s\": %s\n",
argv[1], strerror ( -rc ) );
return 1;