Skip to content

Commit

Permalink
backend/fs.c: Fix clang11 timespec implicit conversion changes signed…
Browse files Browse the repository at this point in the history
…ness errors.

Explicitly cast as per POSIX definition. [1]

[1] https://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html

Signed-off-by: John Coyle <[email protected]>
  • Loading branch information
dx9 committed Oct 3, 2019
1 parent 7ee92e7 commit 62833d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2555,8 +2555,8 @@ fs_setattr(void *softc, struct l9p_request *req)

if (mask & L9PL_SETATTR_ATIME) {
if (mask & L9PL_SETATTR_ATIME_SET) {
ts[0].tv_sec = req->lr_req.tsetattr.atime_sec;
ts[0].tv_nsec = req->lr_req.tsetattr.atime_nsec;
ts[0].tv_sec = (time_t)req->lr_req.tsetattr.atime_sec;
ts[0].tv_nsec = (long)req->lr_req.tsetattr.atime_nsec;
} else {
if (clock_gettime(CLOCK_REALTIME, &ts[0]) != 0) {
error = errno;
Expand All @@ -2567,8 +2567,8 @@ fs_setattr(void *softc, struct l9p_request *req)

if (mask & L9PL_SETATTR_MTIME) {
if (mask & L9PL_SETATTR_MTIME_SET) {
ts[1].tv_sec = req->lr_req.tsetattr.mtime_sec;
ts[1].tv_nsec = req->lr_req.tsetattr.mtime_nsec;
ts[1].tv_sec = (time_t)req->lr_req.tsetattr.mtime_sec;
ts[1].tv_nsec = (long)req->lr_req.tsetattr.mtime_nsec;
} else {
if (clock_gettime(CLOCK_REALTIME, &ts[1]) != 0) {
error = errno;
Expand Down

0 comments on commit 62833d7

Please sign in to comment.