From: munkyu.im Date: Tue, 4 Sep 2012 04:50:02 +0000 (+0900) Subject: [Title]fix not truncating kernel log problem and remove annotaions X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1444^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c25930d2e89a471c13aa4dc0944da26be7fd342d;p=sdk%2Femulator%2Fqemu.git [Title]fix not truncating kernel log problem and remove annotaions [Type]Bugfix [Module] [Priority] [CQ#]S1-8252 [Redmine#] [Problem] [Cause] [Solution]add O_TRUNC option when file open [TestCase] --- diff --git a/block/raw-win32.c b/block/raw-win32.c index 03e9b76f43..bbd4a57695 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -110,13 +110,6 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) } #else - /* - s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename), - access_flags, - FILE_SHARE_READ, NULL, - OPEN_EXISTING, overlapped, NULL); - */ - #include int open_flags = O_BINARY; open_flags &= ~O_ACCMODE; diff --git a/qemu-char.c b/qemu-char.c index 554b127491..299fd59b8b 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1527,13 +1527,7 @@ static int win_chr_init(CharDriverState *chr, const char *filename) GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); #else - /* - s->hcom = CreateFile(g_win32_locale_filename_from_utf8(filename), - GENERIC_READ|GENERIC_WRITE, 0, NULL, - OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); - */ - int open_flags = O_BINARY; - open_flags |= O_RDWR; + int open_flags = O_BINARY | O_RDWR; // TODO : FILE_FLAG_OVERLAPPED int ret = qemu_open(filename, open_flags, 0644); @@ -1836,13 +1830,7 @@ static int qemu_chr_open_win_file_out(QemuOpts *opts, CharDriverState **_chr) fd_out = CreateFile(file_out, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); #else - /* - fd_out = CreateFile(g_win32_locale_filename_from_utf8(file_out), GENERIC_WRITE, FILE_SHARE_READ, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - */ - int open_flags = O_BINARY; - open_flags |= O_RDWR; - open_flags |= O_CREAT; + int open_flags = O_BINARY | O_RDWR | O_CREAT | O_TRUNC; int ret = qemu_open(file_out, open_flags, 0644); if (ret < 0) {