]> Git Repo - J-u-boot.git/blobdiff - fs/semihostingfs.c
Merge patch series "pxe: Allow extlinux booting without CMDLINE enabled"
[J-u-boot.git] / fs / semihostingfs.c
index 96eb3349a2f84133bb03607703e1f5b417787fca..3592338a6865ec06d64a000b89207c53a7e71dfd 100644 (file)
@@ -57,7 +57,11 @@ static int smh_fs_write_at(const char *filename, loff_t pos, void *buffer,
 {
        long fd, size, ret;
 
+       /* Try to open existing file */
        fd = smh_open(filename, MODE_READ | MODE_BINARY | MODE_PLUS);
+       if (fd < 0)
+               /* Create new file */
+               fd = smh_open(filename, MODE_WRITE | MODE_BINARY);
        if (fd < 0)
                return fd;
        ret = smh_seek(fd, pos);
This page took 0.026048 seconds and 4 git commands to generate.