shiny/driver/x11driver: fix ipcCreat constant.

That constant value had a typo. Its value (defined in
/usr/include/linux/ipc.h) is in octal, not hexadecimal.

"man shmget" suggests that the IPC_CREAT flag isn't necessary if the key
is IPC_PRIVATE, as has proven in practice by the current code passing
the wrong flag bit all along.

The best fix, for the Go code, is to delete all mentions of ipcCreat.

Change-Id: I1ec701b3069c35445058c1149f2e9d15bbf4cf4c
Reviewed-on: https://go-review.googlesource.com/28012
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Nigel Tao 2016-08-29 14:21:06 +10:00
Родитель 325d5821a8
Коммит da927ba5e2
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -13,12 +13,11 @@ import (
// These constants are from /usr/include/linux/ipc.h
const (
ipcPrivate = 0
ipcCreat = 0x1000
ipcRmID = 0
)
func shmOpen(size int) (shmid uintptr, addr unsafe.Pointer, err error) {
shmid, _, errno0 := syscall.RawSyscall(syscall.SYS_SHMGET, ipcPrivate, uintptr(size), ipcCreat|0600)
shmid, _, errno0 := syscall.RawSyscall(syscall.SYS_SHMGET, ipcPrivate, uintptr(size), 0600)
if errno0 != 0 {
return 0, unsafe.Pointer(uintptr(0)), fmt.Errorf("shmget: %v", errno0)
}