From 4fc72a0ade0d5413321cbe2c9dee26f459264c24 Mon Sep 17 00:00:00 2001 From: Jinseek Ryu Date: Tue, 13 Sep 2022 13:03:06 +0900 Subject: [PATCH] fix ipc_perm struct mode type to C.__mode_t from C.ushort because some OS version got diffrente type --- msg.go | 2 +- sem.go | 2 +- shm.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/msg.go b/msg.go index 481e425..8dd5253 100644 --- a/msg.go +++ b/msg.go @@ -98,7 +98,7 @@ func (mq MessageQueue) Set(mqi *MQInfo) error { msg_perm: C.struct_ipc_perm{ uid: C.__uid_t(mqi.Perms.OwnerUID), gid: C.__gid_t(mqi.Perms.OwnerGID), - mode: C.ushort(mqi.Perms.Mode & 0x1FF), + mode: C.__mode_t(mqi.Perms.Mode & 0x1FF), }, msg_qbytes: C.msglen_t(mqi.MaxBytes), } diff --git a/sem.go b/sem.go index f425f17..07284e4 100644 --- a/sem.go +++ b/sem.go @@ -183,7 +183,7 @@ func (ss *SemaphoreSet) Set(ssi *SemSetInfo) error { sem_perm: C.struct_ipc_perm{ uid: C.__uid_t(ssi.Perms.OwnerUID), gid: C.__gid_t(ssi.Perms.OwnerGID), - mode: C.ushort(ssi.Perms.Mode & 0x1FF), + mode: C.__mode_t(ssi.Perms.Mode & 0x1FF), }, } diff --git a/shm.go b/shm.go index b28506c..eec733e 100644 --- a/shm.go +++ b/shm.go @@ -82,7 +82,7 @@ func (shm *SharedMem) Set(info *SHMInfo) error { shm_perm: C.struct_ipc_perm{ uid: C.__uid_t(info.Perms.OwnerUID), gid: C.__gid_t(info.Perms.OwnerGID), - mode: C.ushort(info.Perms.Mode & 0x1FF), + mode: C.__mode_t(info.Perms.Mode & 0x1FF), }, }