aboutsummaryrefslogtreecommitdiffstats
path: root/libinstaller
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-06-24 13:03:35 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-24 13:03:35 -0700
commitd52b620e4f296cd1cb48afdcead64fc1b040e0dc (patch)
tree3b632b278cfc6da652080b72cb35d150c9adb367 /libinstaller
parente20df33ead999ba1247d57c89065c8d1ac3e7075 (diff)
downloadsyslinux-d52b620e4f296cd1cb48afdcead64fc1b040e0dc.tar.gz
syslinux-d52b620e4f296cd1cb48afdcead64fc1b040e0dc.tar.xz
syslinux-d52b620e4f296cd1cb48afdcead64fc1b040e0dc.zip
advio: make read_adv() distinguish ENOENT from other errors
Make it possible to distinguish ENOENT from other "non-fatal" errors in read_adv(), so we can try more than one filename. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'libinstaller')
-rw-r--r--libinstaller/advio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libinstaller/advio.c b/libinstaller/advio.c
index 3112fa42..7bfc098c 100644
--- a/libinstaller/advio.c
+++ b/libinstaller/advio.c
@@ -36,8 +36,8 @@
/*
* Read the ADV from an existing instance, or initialize if invalid.
- * Returns -1 on fatal errors, 0 if ADV is okay, and 1 if no valid
- * ADV was found.
+ * Returns -1 on fatal errors, 0 if ADV is okay, 1 if the ADV is
+ * invalid, and 2 if the file does not exist.
*/
int read_adv(const char *path, const char *cfg)
{
@@ -60,6 +60,7 @@ int read_adv(const char *path, const char *cfg)
err = -1;
} else {
syslinux_reset_adv(syslinux_adv);
+ err = 2; /* Nonexistence is not a fatal error */
}
} else if (fstat(fd, &st)) {
err = -1;