summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-05-13 18:19:22 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-05-13 18:19:22 +0100
commitebd2ff37a9eba9412456c42398f64a3cb107b79c (patch)
treedbc355d085fe0bc2c7754a7dccdd18821cda4f57 /lib
parentb8ad15031cacf910634b4f4f4632232949c4acd2 (diff)
downloadhivex-ebd2ff37a9eba9412456c42398f64a3cb107b79c.tar.gz
hivex-ebd2ff37a9eba9412456c42398f64a3cb107b79c.tar.xz
hivex-ebd2ff37a9eba9412456c42398f64a3cb107b79c.zip
hivex_root: Return errno == HIVEX_NO_KEY when root key is missing.
Previously we returned errno == ENOKEY. However this was an unfortunate choice of error code since it is not defined in POSIX. As a result it is missing on several platforms. HIVEX_NO_KEY is defined as ENOKEY on platforms where this symbol exists (thus maintaining backwards ABI compatibility), and defined as another POSIX error code otherwise.
Diffstat (limited to 'lib')
-rw-r--r--lib/hivex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hivex.c b/lib/hivex.c
index 7715520..d042f4f 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -559,7 +559,7 @@ hivex_root (hive_h *h)
{
hive_node_h ret = h->rootoffs;
if (!IS_VALID_BLOCK (h, ret)) {
- errno = ENOKEY;
+ errno = HIVEX_NO_KEY;
return 0;
}
return ret;