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

Side by Side Diff: services/files/shared_impl.cc

Issue 1355403002: enum class fixups - testing non-zero (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 months 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 | « services/files/file_impl.cc ('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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/files/shared_impl.h" 5 #include "services/files/shared_impl.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <time.h> 10 #include <time.h>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 callback.Run(ERROR_OK, file_info.Pass()); 53 callback.Run(ERROR_OK, file_info.Pass());
54 } 54 }
55 55
56 void TouchFD(int fd, 56 void TouchFD(int fd,
57 TimespecOrNowPtr atime, 57 TimespecOrNowPtr atime,
58 TimespecOrNowPtr mtime, 58 TimespecOrNowPtr mtime,
59 const TouchFDCallback& callback) { 59 const TouchFDCallback& callback) {
60 DCHECK_NE(fd, -1); 60 DCHECK_NE(fd, -1);
61 61
62 struct timespec times[2]; 62 struct timespec times[2];
63 if (Error error = TimespecOrNowToStandardTimespec(atime.get(), &times[0])) { 63 Error error = TimespecOrNowToStandardTimespec(atime.get(), &times[0]);
64 if (error != ERROR_OK) {
64 callback.Run(error); 65 callback.Run(error);
65 return; 66 return;
66 } 67 }
67 if (Error error = TimespecOrNowToStandardTimespec(mtime.get(), &times[1])) { 68
69 error = TimespecOrNowToStandardTimespec(mtime.get(), &times[1]);
70 if (error != ERROR_OK) {
68 callback.Run(error); 71 callback.Run(error);
69 return; 72 return;
70 } 73 }
71 74
72 if (futimens(fd, times) != 0) { 75 if (futimens(fd, times) != 0) {
73 callback.Run(ErrnoToError(errno)); 76 callback.Run(ErrnoToError(errno));
74 return; 77 return;
75 } 78 }
76 79
77 callback.Run(ERROR_OK); 80 callback.Run(ERROR_OK);
78 } 81 }
79 82
80 } // namespace files 83 } // namespace files
81 } // namespace mojo 84 } // namespace mojo
OLDNEW
« no previous file with comments | « services/files/file_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698