Gentoo Archives: gentoo-commits

From: "Alexey Shvetsov (alexxy)" <alexxy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/kdm/files: kdm-4.3.1-set-grub-default.patch
Date: Tue, 06 Oct 2009 21:00:57
Message-Id: E1MvH9T-0003uA-4S@stork.gentoo.org
1 alexxy 09/10/06 21:00:55
2
3 Added: kdm-4.3.1-set-grub-default.patch
4 Log:
5 [kde-base/kdm] Backport set
6 (Portage version: 2.2_rc44/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 kde-base/kdm/files/kdm-4.3.1-set-grub-default.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdm/files/kdm-4.3.1-set-grub-default.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kdm/files/kdm-4.3.1-set-grub-default.patch?rev=1.1&content-type=text/plain
13
14 Index: kdm-4.3.1-set-grub-default.patch
15 ===================================================================
16 Index: kdm/backend/bootman.c
17 ===================================================================
18 --- kdm/backend/bootman.c (revision 1030992)
19 +++ kdm/backend/bootman.c (revision 1030993)
20 @@ -80,7 +80,7 @@
21 int len;
22 char line[1000];
23
24 - if (!grub && !(grub = locate( "grub" )))
25 + if (!grub && !(grub = locate( "grub-set-default" )))
26 return BO_NOMAN;
27
28 *def = 0;
29 @@ -130,19 +130,15 @@
30 static void
31 commitGrub( void )
32 {
33 - FILE *f;
34 - int pid;
35 - static const char *args[] = { 0, "--batch", "--no-floppy", 0 };
36 + char index[16];
37 + const char *args[3] = { grub, index, 0 };
38
39 if (sdRec.bmstamp != mTime( GRUB_MENU ) &&
40 setGrub( sdRec.osname, &sdRec ) != BO_OK)
41 return;
42
43 - args[0] = grub;
44 - if ((f = pOpen( (char **)args, 'w', &pid ))) {
45 - fprintf( f, "savedefault --default=%d --once\n", sdRec.osindex );
46 - pClose( f, &pid );
47 - }
48 + sprintf( index, "%d", sdRec.osindex );
49 + runAndWait( (char **)args, environ );
50 }
51
52 static char *lilo;