Prevent shadowing of stdlib's devname(3) on BSD.

This commit is contained in:
Grégoire Sutre 2013-08-12 11:49:33 +02:00
parent c137aea04b
commit 418f86c659
2 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2013-08-12 Grégoire Sutre <gregoire.sutre@gmail.com>
Prevent shadowing of stdlib's devname(3) on BSD.
* grub-core/disk/cryptodisk.c (grub_cmd_cryptomount): Rename devname
and devlast to diskname and disklast, respectively.
2013-08-11 Colin Watson <cjwatson@ubuntu.com> 2013-08-11 Colin Watson <cjwatson@ubuntu.com>
* util/grub-mkconfig.in: Fix detection of Emacs autosave files. * util/grub-mkconfig.in: Fix detection of Emacs autosave files.

View file

@ -937,20 +937,20 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args)
grub_err_t err; grub_err_t err;
grub_disk_t disk; grub_disk_t disk;
grub_cryptodisk_t dev; grub_cryptodisk_t dev;
char *devname; char *diskname;
char *devlast; char *disklast;
search_uuid = NULL; search_uuid = NULL;
check_boot = state[2].set; check_boot = state[2].set;
devname = args[0]; diskname = args[0];
if (devname[0] == '(' && *(devlast = &devname[grub_strlen (devname) - 1]) == ')') if (diskname[0] == '(' && *(disklast = &diskname[grub_strlen (diskname) - 1]) == ')')
{ {
*devlast = '\0'; *disklast = '\0';
disk = grub_disk_open (devname + 1); disk = grub_disk_open (diskname + 1);
*devlast = ')'; *disklast = ')';
} }
else else
disk = grub_disk_open (devname); disk = grub_disk_open (diskname);
if (!disk) if (!disk)
return grub_errno; return grub_errno;