http://git.etherboot.org
/
people
/
andreif
/
gpxe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
726e366
)
Cope with non-newline-terminated scripts.
author
Michael Brown
<mcb30@etherboot.org>
Thu, 2 Aug 2007 00:12:42 +0000
(
01:12
+0100)
committer
Michael Brown
<mcb30@etherboot.org>
Thu, 2 Aug 2007 00:12:42 +0000
(
01:12
+0100)
Print error status using strerror().
src/image/script.c
patch
|
blob
|
history
diff --git
a/src/image/script.c
b/src/image/script.c
index
8e511d2
..
c882152
100644
(file)
--- a/
src/image/script.c
+++ b/
src/image/script.c
@@
-58,6
+58,7
@@
static int script_exec ( struct image *image ) {
len = sizeof ( cmdbuf );
if ( len > remaining )
len = remaining;
+ memset ( cmdbuf, 0, sizeof ( cmdbuf ) );
copy_from_user ( cmdbuf, image->data, offset, len );
/* Find end of line */
@@
-75,8
+76,8
@@
static int script_exec ( struct image *image ) {
*eol = '\0';
DBG ( "$ %s\n", cmdbuf );
if ( ( rc = system ( cmdbuf ) ) != 0 ) {
- DBG ( "Command \"%s\"
exited with status %d
\n",
- cmdbuf,
rc
);
+ DBG ( "Command \"%s\"
failed: %s
\n",
+ cmdbuf,
strerror ( rc )
);
goto done;
}