summaryrefslogtreecommitdiffstats
path: root/serprog.c
diff options
context:
space:
mode:
authorUrja Rannikko <urjaman@gmail.com>2016-01-04 03:05:23 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2016-01-04 03:05:23 +0000
commit27b431bceed902974ffcbe5fce474e3a8f193350 (patch)
treecccdb3718ce2b2399efa0e011c6cca0ba41bc45e /serprog.c
parent72587f85ec0f85719c163905933e31a946f54bdf (diff)
downloadflashrom-27b431bceed902974ffcbe5fce474e3a8f193350.tar.gz
flashrom-27b431bceed902974ffcbe5fce474e3a8f193350.tar.bz2
flashrom-27b431bceed902974ffcbe5fce474e3a8f193350.zip
serprog: fix missing device parameter error message on Windows
Previously, flashrom -p serprog didnt notice a completely missing dev= string on Windows. Also, the error message shown if no device name followed contained a misleading "/dev/...". Corresponding to flashrom svn r1908. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'serprog.c')
-rw-r--r--serprog.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/serprog.c b/serprog.c
index 917aba5cb..981798f99 100644
--- a/serprog.c
+++ b/serprog.c
@@ -371,6 +371,8 @@ int serprog_init(void)
have_device++;
}
}
+
+#if !IS_WINDOWS
if (device && !strlen(device)) {
msg_perr("Error: No device specified.\n"
"Use flashrom -p serprog:dev=/dev/device[:baud]\n");
@@ -379,7 +381,6 @@ int serprog_init(void)
}
free(device);
-#if !IS_WINDOWS
device = extract_programmer_param("ip");
if (have_device && device) {
msg_perr("Error: Both host and device specified.\n"
@@ -415,15 +416,20 @@ int serprog_init(void)
free(device);
return 1;
}
+#endif
free(device);
if (!have_device) {
+#if IS_WINDOWS
+ msg_perr("Error: No device specified.\n"
+ "Use flashrom -p serprog:dev=comN[:baud]\n");
+#else
msg_perr("Error: Neither host nor device specified.\n"
"Use flashrom -p serprog:dev=/dev/device:baud or "
"flashrom -p serprog:ip=ipaddr:port\n");
+#endif
return 1;
}
-#endif
if (register_shutdown(serprog_shutdown, NULL))
return 1;