[syslinux] [PATCH 8/9] win: Print error message if we fail to install to --directory

Matt Fleming matt at console-pimps.org
Fri Nov 2 07:13:17 PDT 2012


From: Matt Fleming <matt.fleming at intel.com>

Instead of silently returning with no indication of error if we
couldn't install to the --directory argument, print an error message
that tells the user the files are not where they wanted.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
 win/syslinux.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/win/syslinux.c b/win/syslinux.c
index 64369d5..c291f00 100644
--- a/win/syslinux.c
+++ b/win/syslinux.c
@@ -272,11 +272,15 @@ static void move_file(char *pathname, char *filename)
 	/* Delete any previous file */
 	SetFileAttributes(new_name, FILE_ATTRIBUTE_NORMAL);
 	DeleteFile(new_name);
-	if (!MoveFile(pathname, new_name))
+	if (!MoveFile(pathname, new_name)) {
+	    fprintf(stderr,
+		    "Failed to move %s to destination directory: %s\n",
+		    filename, opt.directory);
+
 	    SetFileAttributes(pathname, FILE_ATTRIBUTE_READONLY |
 			      FILE_ATTRIBUTE_SYSTEM |
 			      FILE_ATTRIBUTE_HIDDEN);
-	else
+	} else
 	    SetFileAttributes(new_name, FILE_ATTRIBUTE_READONLY |
 			      FILE_ATTRIBUTE_SYSTEM |
 			      FILE_ATTRIBUTE_HIDDEN);
-- 
1.7.11.7




More information about the Syslinux mailing list