| OLD | NEW |
| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { | 146 void sk_fsync(FILE* f) { |
| 147 #if !defined(_WIN32) && !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) \ | 147 #if !defined(_WIN32) && !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) \ |
| 148 && !defined(_NEWLIB_VERSION) | 148 && !defined(_NEWLIB_VERSION) && !defined(__Fuchsia__) |
| 149 int fd = fileno(f); | 149 int fd = fileno(f); |
| 150 fsync(fd); | 150 fsync(fd); |
| 151 #endif | 151 #endif |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool sk_fseek(FILE* f, size_t byteCount) { | 154 bool sk_fseek(FILE* f, size_t byteCount) { |
| 155 int err = fseek(f, (long)byteCount, SEEK_SET); | 155 int err = fseek(f, (long)byteCount, SEEK_SET); |
| 156 return err == 0; | 156 return err == 0; |
| 157 } | 157 } |
| 158 | 158 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 #else | 199 #else |
| 200 retval = mkdir(path, 0777); | 200 retval = mkdir(path, 0777); |
| 201 #endif | 201 #endif |
| 202 if (0 == retval) { | 202 if (0 == retval) { |
| 203 return true; | 203 return true; |
| 204 } else { | 204 } else { |
| 205 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); |
| 206 return false; | 206 return false; |
| 207 } | 207 } |
| 208 } | 208 } |
| OLD | NEW |