summaryrefslogtreecommitdiff
blob: 54843d51803bd3eb0032ce07e558a6900005426c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Index: kdm/backend/bootman.c
===================================================================
--- kdm/backend/bootman.c	(revision 1030992)
+++ kdm/backend/bootman.c	(revision 1030993)
@@ -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,15 @@
 static void
 commitGrub( void )
 {
-	FILE *f;
-	int pid;
-	static const char *args[] = { 0, "--batch", "--no-floppy", 0 };
+	char index[16];
+	const char *args[3] = { grub, index, 0 };
 
 	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( index, "%d", sdRec.osindex );
+	runAndWait( (char **)args, environ );
 }
 
 static char *lilo;