summaryrefslogtreecommitdiff
path: root/ipc/sem.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-04-12 16:19:44 +0300
committerArnd Bergmann <arnd@arndb.de>2018-04-20 17:20:18 +0300
commit2a70b7879b84d471fd0e440f027bba310e0c1fb7 (patch)
treeffb63998dfdb5fdd2636874299c9785c1271ee71 /ipc/sem.c
parentb497ef570ecdeeaef4335ecc4f712cbaae0918a5 (diff)
downloadlinux-2a70b7879b84d471fd0e440f027bba310e0c1fb7.tar.xz
y2038: ipc: Use ktime_get_real_seconds consistently
In some places, we still used get_seconds() instead of ktime_get_real_seconds(), and I'm changing the remaining ones now to all use ktime_get_real_seconds() so we use the full available range for timestamps instead of overflowing the 'unsigned long' return value in year 2106 on 32-bit kernels. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'ipc/sem.c')
-rw-r--r--ipc/sem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 06be75d9217a..c6a8a971769d 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -104,7 +104,7 @@ struct sem {
/* that alter the semaphore */
struct list_head pending_const; /* pending single-sop operations */
/* that do not alter the semaphore*/
- time_t sem_otime; /* candidate for sem_otime */
+ time64_t sem_otime; /* candidate for sem_otime */
} ____cacheline_aligned_in_smp;
/* One sem_array data structure for each set of semaphores in the system. */
@@ -984,10 +984,10 @@ again:
static void set_semotime(struct sem_array *sma, struct sembuf *sops)
{
if (sops == NULL) {
- sma->sems[0].sem_otime = get_seconds();
+ sma->sems[0].sem_otime = ktime_get_real_seconds();
} else {
sma->sems[sops[0].sem_num].sem_otime =
- get_seconds();
+ ktime_get_real_seconds();
}
}