[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] fixes for kernel of FreeBSD
From: |
Robert Millan |
Subject: |
Re: [patch] fixes for kernel of FreeBSD |
Date: |
Fri, 21 Apr 2006 15:35:41 +0200 |
User-agent: |
Mutt/1.5.11+cvs20060403 |
Or better this one instead. Additionaly it avoids the third sysctl call when
the second one failed (i.e. we were unable to set the flags, therefore we don't
need to set them back).
2006-04-21 Robert Millan <address@hidden>
* grub/asmstub.c (get_diskinfo): Optimize sysctl routine.
Index: grub/asmstub.c
===================================================================
RCS file: /sources/grub/grub/grub/asmstub.c,v
retrieving revision 1.85
diff -u -r1.85 asmstub.c
--- grub/asmstub.c 20 Apr 2006 13:46:45 -0000 1.85
+++ grub/asmstub.c 21 Apr 2006 13:28:26 -0000
@@ -797,8 +797,13 @@
flags = old_flags | 0x10;
if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int))
!= 0)
- grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n",
strerror (errno));
+ {
+ flags = old_flags;
+ grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n",
strerror (errno));
+ }
}
+ else
+ flags = old_flags;
#endif
disks[drive].flags = open (devname, O_RDWR);
#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
--
Robert Millan