Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: src/ports/SkOSFile_stdio.cpp

Issue 1530783003: add fsync to try to get complete skps from webpage picture capture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make sync nonvirtual Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkStream.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkOSFile.h" 8 #include "SkOSFile.h"
9 #include "SkTypes.h" 9 #include "SkTypes.h"
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 size_t sk_fwrite(const void* buffer, size_t byteCount, FILE* f) { 136 size_t sk_fwrite(const void* buffer, size_t byteCount, FILE* f) {
137 SkASSERT(f); 137 SkASSERT(f);
138 return ::fwrite(buffer, 1, byteCount, f); 138 return ::fwrite(buffer, 1, byteCount, f);
139 } 139 }
140 140
141 void sk_fflush(FILE* f) { 141 void sk_fflush(FILE* f) {
142 SkASSERT(f); 142 SkASSERT(f);
143 ::fflush(f); 143 ::fflush(f);
144 } 144 }
145 145
146 void sk_fsync(FILE* f) {
147 #if !defined(_WIN32) && !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) \
148 && !defined(_NEWLIB_VERSION)
149 int fd = ::fileno(f);
150 ::fsync(fd);
151 #endif
152 }
153
146 bool sk_fseek(FILE* f, size_t byteCount) { 154 bool sk_fseek(FILE* f, size_t byteCount) {
147 int err = ::fseek(f, (long)byteCount, SEEK_SET); 155 int err = ::fseek(f, (long)byteCount, SEEK_SET);
148 return err == 0; 156 return err == 0;
149 } 157 }
150 158
151 bool sk_fmove(FILE* f, long byteCount) { 159 bool sk_fmove(FILE* f, long byteCount) {
152 int err = ::fseek(f, byteCount, SEEK_CUR); 160 int err = ::fseek(f, byteCount, SEEK_CUR);
153 return err == 0; 161 return err == 0;
154 } 162 }
155 163
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 #else 199 #else
192 retval = mkdir(path, 0777); 200 retval = mkdir(path, 0777);
193 #endif 201 #endif
194 if (0 == retval) { 202 if (0 == retval) {
195 return true; 203 return true;
196 } else { 204 } else {
197 fprintf(stderr, "sk_mkdir: error %d creating dir '%s'\n", errno, path); 205 fprintf(stderr, "sk_mkdir: error %d creating dir '%s'\n", errno, path);
198 return false; 206 return false;
199 } 207 }
200 } 208 }
OLDNEW
« no previous file with comments | « src/core/SkStream.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698