diff options
author | Michael Brown | 2012-10-25 08:21:49 +0200 |
---|---|---|
committer | Michael Brown | 2012-10-25 08:24:43 +0200 |
commit | 2c011d77ae0147b8cc68bc4f3c577ebf55b83f16 (patch) | |
tree | 4eaa0afca5fcaa5963799408d29eb60b456fc512 /src/hci/commands | |
parent | [netdevice] Clear network device setting before unregistering (diff) | |
download | ipxe-2c011d77ae0147b8cc68bc4f3c577ebf55b83f16.tar.gz ipxe-2c011d77ae0147b8cc68bc4f3c577ebf55b83f16.tar.xz ipxe-2c011d77ae0147b8cc68bc4f3c577ebf55b83f16.zip |
[readline] Allow readline_history() to return a meaningful status
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/commands')
-rw-r--r-- | src/hci/commands/nvo_cmd.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/hci/commands/nvo_cmd.c b/src/hci/commands/nvo_cmd.c index b3775d09..f255bbf5 100644 --- a/src/hci/commands/nvo_cmd.c +++ b/src/hci/commands/nvo_cmd.c @@ -213,15 +213,19 @@ static int read_value ( const char *name, char **args __unused, char **value ) { /* Read existing value */ if ( ( rc = fetchf_named_setting_copy ( name, &existing ) ) < 0 ) - return rc; + goto err_existing; /* Read new value */ - *value = readline_history ( NULL, existing, NULL ); + if ( ( rc = readline_history ( NULL, existing, NULL, value ) ) != 0 ) + goto err_new; - /* Free existing value */ - free ( existing ); + /* Success */ + rc = 0; - return 0; + err_new: + free ( existing ); + err_existing: + return rc; } /** |