diff options
author | Ravishankar N <ravishankar@redhat.com> | 2013-11-09 11:56:34 +0000 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-11-10 19:41:59 -0800 |
commit | d5335f9e40f6e9533f7812d153b9727bcc04aa4e (patch) | |
tree | eed8d0f7ba0ef1039c2bd89f6c6b95d0df72e1d3 /libglusterfs/src/timespec.c | |
parent | c80794079a246f4fee730d028350e80c38dbf034 (diff) |
libglusterfs: fix bug in timespec adjustment
The argument to the timespec_adjust_delta() function introudced in
commit 6836118b21 needs to be passed by reference rather than by value
for the function to do it's job.
BUG: 1028663
Change-Id: I62a3636906e67ed35b7786e9553f6819b48f3626
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/6243
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/timespec.c')
-rw-r--r-- | libglusterfs/src/timespec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libglusterfs/src/timespec.c b/libglusterfs/src/timespec.c index 0df74e61c20..a0c281a1efb 100644 --- a/libglusterfs/src/timespec.c +++ b/libglusterfs/src/timespec.c @@ -60,9 +60,9 @@ void timespec_now (struct timespec *ts) ts->tv_sec, ts->tv_nsec); } -void timespec_adjust_delta (struct timespec ts, struct timespec delta) +void timespec_adjust_delta (struct timespec *ts, struct timespec delta) { - ts.tv_nsec = ((ts.tv_nsec + delta.tv_nsec) % 1000000000); - ts.tv_sec += ((ts.tv_nsec + delta.tv_nsec) / 1000000000); - ts.tv_sec += delta.tv_sec; + ts->tv_nsec = ((ts->tv_nsec + delta.tv_nsec) % 1000000000); + ts->tv_sec += ((ts->tv_nsec + delta.tv_nsec) / 1000000000); + ts->tv_sec += delta.tv_sec; } |