mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
[image] Allow image_set_cmdline() to clear the command line
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -95,14 +95,18 @@ void image_set_uri ( struct image *image, struct uri *uri ) {
|
|||||||
* Set image command line
|
* Set image command line
|
||||||
*
|
*
|
||||||
* @v image Image
|
* @v image Image
|
||||||
* @v cmdline New image command line
|
* @v cmdline New image command line, or NULL
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
int image_set_cmdline ( struct image *image, const char *cmdline ) {
|
int image_set_cmdline ( struct image *image, const char *cmdline ) {
|
||||||
|
|
||||||
free ( image->cmdline );
|
free ( image->cmdline );
|
||||||
image->cmdline = strdup ( cmdline );
|
image->cmdline = NULL;
|
||||||
if ( ! image->cmdline )
|
if ( cmdline ) {
|
||||||
return -ENOMEM;
|
image->cmdline = strdup ( cmdline );
|
||||||
|
if ( ! image->cmdline )
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user