char-file.c (59c58f96b270f5edd4ad10954c3a96556cb3a728) | char-file.c (8de69efab1009d374c7f01d2536797ea009ee796) |
---|---|
1/* 2 * QEMU System Emulator 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 31 unchanged lines hidden (view full) --- 40 Error **errp) 41{ 42 ChardevFile *file = backend->u.file.data; 43#ifdef _WIN32 44 HANDLE out; 45 DWORD accessmode; 46 DWORD flags; 47 | 1/* 2 * QEMU System Emulator 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 31 unchanged lines hidden (view full) --- 40 Error **errp) 41{ 42 ChardevFile *file = backend->u.file.data; 43#ifdef _WIN32 44 HANDLE out; 45 DWORD accessmode; 46 DWORD flags; 47 |
48 if (file->has_in) { | 48 if (file->in) { |
49 error_setg(errp, "input file not supported"); 50 return; 51 } 52 53 if (file->has_append && file->append) { 54 /* Append to file if it already exists. */ 55 accessmode = FILE_GENERIC_WRITE & ~FILE_WRITE_DATA; 56 flags = OPEN_ALWAYS; --- 21 unchanged lines hidden (view full) --- 78 flags |= O_TRUNC; 79 } 80 81 out = qmp_chardev_open_file_source(file->out, flags, errp); 82 if (out < 0) { 83 return; 84 } 85 | 49 error_setg(errp, "input file not supported"); 50 return; 51 } 52 53 if (file->has_append && file->append) { 54 /* Append to file if it already exists. */ 55 accessmode = FILE_GENERIC_WRITE & ~FILE_WRITE_DATA; 56 flags = OPEN_ALWAYS; --- 21 unchanged lines hidden (view full) --- 78 flags |= O_TRUNC; 79 } 80 81 out = qmp_chardev_open_file_source(file->out, flags, errp); 82 if (out < 0) { 83 return; 84 } 85 |
86 if (file->has_in) { | 86 if (file->in) { |
87 flags = O_RDONLY; 88 in = qmp_chardev_open_file_source(file->in, flags, errp); 89 if (in < 0) { 90 qemu_close(out); 91 return; 92 } 93 } 94 --- 47 unchanged lines hidden --- | 87 flags = O_RDONLY; 88 in = qmp_chardev_open_file_source(file->in, flags, errp); 89 if (in < 0) { 90 qemu_close(out); 91 return; 92 } 93 } 94 --- 47 unchanged lines hidden --- |