git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
arch
/
mips
/
boot
/
addinitrd.c
diff --git
a/arch/mips/boot/addinitrd.c
b/arch/mips/boot/addinitrd.c
index
38261f1
..
8b30333
100644
(file)
--- a/
arch/mips/boot/addinitrd.c
+++ b/
arch/mips/boot/addinitrd.c
@@
-2,6
+2,8
@@
* addinitrd - program to add a initrd image to an ecoff kernel
*
* (C) 1999 Thomas Bogendoerfer
* addinitrd - program to add a initrd image to an ecoff kernel
*
* (C) 1999 Thomas Bogendoerfer
+ * minor modifications, cleanup: Guido Guenther <agx@sigxcpu.org>
+ * further cleanup: Maciej W. Rozycki
*/
#include <sys/types.h>
*/
#include <sys/types.h>
@@
-54,7
+56,7
@@
int main (int argc, char *argv[])
exit (1);
}
exit (1);
}
- if ((fd_vmlinux = open (argv[1],O_RD
WR
)) < 0)
+ if ((fd_vmlinux = open (argv[1],O_RD
ONLY
)) < 0)
die ("open vmlinux");
if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile)
die ("read file header");
die ("open vmlinux");
if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile)
die ("read file header");
@@
-78,6
+80,11
@@
int main (int argc, char *argv[])
swab = 1;
}
swab = 1;
}
+ /* make sure we have an empty data segment for the initrd */
+ if (eaout.dsize || esecs[1].s_size) {
+ fprintf (stderr, "Data segment not empty. Giving up!\n");
+ exit (1);
+ }
if ((fd_initrd = open (argv[2], O_RDONLY)) < 0)
die ("open initrd");
if (fstat (fd_initrd, &st) < 0)
if ((fd_initrd = open (argv[2], O_RDONLY)) < 0)
die ("open initrd");
if (fstat (fd_initrd, &st) < 0)