linux: Clear up error message
authorMatt Fleming <matt.fleming@intel.com>
Thu, 25 Apr 2013 14:14:18 +0000 (15:14 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Thu, 25 Apr 2013 14:24:35 +0000 (15:24 +0100)
commitfaff52ef2bd3dca503a6fef3129f02284e9b6ca4
tree9828522a2e4cbed3a35f4a268b7712353227a449
parent461a38b0a59e58567b94f9a74ce34c1baded29ba
linux: Clear up error message

Passing opt.device to perror() in do_open_file() results in confusing
error messages, as Jack reports,

  Last night, I was trying to install syslinux (5.01) to a SD card of
  mine, writing to a subdirectory to keep the layout neat:

  syslinux-5.01/linux# ./syslinux -i -d /boot /dev/mmcblk0p1
  /dev/mmcblk0p1: No such file or directory

  The message is coming from do_open_file() in syslinux.c: the call to
  open() fails because the containing directory isn't present, and then it
  calls perror(opt.device).

We should instead be passing 'name' to perror() so that we know _which_
file doesn't exist.

Reported-by: Jack Kelly <jack@jackkelly.name>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
linux/syslinux.c