On Thu, Jan 04, 2007 at 06:15:47PM +0900, Horms wrote:
> On Thu, Jan 04, 2007 at 10:34:47AM +0530, Ankita Garg wrote:
> > Hi,
> >
> > o Patch to add a generic function to append a string eg. reset_devices, to
> > the
> > second kernel command line.
>
> This seems fine, though as the return value is always 0 and
> never checked, can you just change it around to return void ?
o Patch to add a generic function to append a string eg. reset_devices, to the
second kernel command line.
Signed-off-by: Ankita Garg <[EMAIL PROTECTED]>
--
kexec.c | 16 ++++++++++++++++
kexec.h | 3 ++-
2 files changed, 18 insertions(+), 1 deletion(-)
Index: kexec-tools-testing-20061214/kexec/kexec.c
===================================================================
--- kexec-tools-testing-20061214.orig/kexec/kexec.c 2006-12-14
02:12:03.000000000 -0500
+++ kexec-tools-testing-20061214/kexec/kexec.c 2008-04-11 23:56:37.000000000
-0500
@@ -347,6 +347,22 @@
return base;
}
+void cmdline_append_string(char *cmdline, char *append_str, int cmdline_size)
+{
+ int cmdlen;
+
+ if(cmdline_size)
+ {
+ cmdlen = strlen(cmdline) + strlen(append_str);
+ if (cmdlen > (cmdline_size - 1))
+ die("Command line overflow\n");
+ }
+ strcat(cmdline, append_str);
+ dfprintf(stdout, "Command line after adding reset_devices\n");
+ dfprintf(stdout, "%s\n", cmdline);
+ return;
+}
+
char *slurp_file(const char *filename, off_t *r_size)
{
int fd;
Index: kexec-tools-testing-20061214/kexec/kexec.h
===================================================================
--- kexec-tools-testing-20061214.orig/kexec/kexec.h 2006-12-14
02:12:03.000000000 -0500
+++ kexec-tools-testing-20061214/kexec/kexec.h 2008-04-11 23:56:19.000000000
-0500
@@ -188,7 +188,8 @@
const void *buf, unsigned long bufsz, unsigned long memsz,
unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
int buf_end);
-
+extern void cmdline_append_string(char *cmdline, char *append_str,
+ int cmdline_size);
extern unsigned char purgatory[];
extern size_t purgatory_size;
Reagrds,
--
Ankita Garg ([EMAIL PROTECTED])
Linux Technology Center
IBM India Systems & Technology Labs,
Bangalore, India
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot