--- kdm/backend/bootman.c 2008-01-05 00:55:44.000000000 +0100 +++ kdm/backend/bootman.c 2008-10-06 22:25:46.000000000 +0200 @@ -80,7 +80,7 @@ int len; char line[1000]; - if (!grub && !(grub = locate( "grub" ))) + if (!grub && !(grub = locate( "grub-set-default" ))) return BO_NOMAN; *def = 0; @@ -130,19 +130,14 @@ static void commitGrub( void ) { - FILE *f; - int pid; - static const char *args[] = { 0, "--batch", "--no-floppy", 0 }; + char command[256]; if (sdRec.bmstamp != mTime( GRUB_MENU ) && setGrub( sdRec.osname, &sdRec ) != BO_OK) return; - args[0] = grub; - if ((f = pOpen( (char **)args, 'w', &pid ))) { - fprintf( f, "savedefault --default=%d --once\n", sdRec.osindex ); - pClose( f, &pid ); - } + sprintf(command, "%s %d", grub, sdRec.osindex); + system(command); } static char *lilo;