aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/os-Linux/mem.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index d24d1a960523..560c8063c77c 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -210,8 +210,11 @@ int create_tmp_file(unsigned long long len)
210 exit(1); 210 exit(1);
211 } 211 }
212 212
213 if (lseek64(fd, len, SEEK_SET) < 0) { 213 /* Seek to len - 1 because writing a character there will
214 perror("os_seek_file"); 214 * increase the file size by one byte, to the desired length.
215 */
216 if (lseek64(fd, len - 1, SEEK_SET) < 0) {
217 perror("os_seek_file");
215 exit(1); 218 exit(1);
216 } 219 }
217 220