提交 8e776e3e 编写于 作者: R Rich Felker

fix inadvertent use of struct in place of union for semun

上级 5f942053
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "syscall.h" #include "syscall.h"
#include "ipc.h" #include "ipc.h"
struct semun { union semun {
int val; int val;
struct semid_ds *buf; struct semid_ds *buf;
unsigned short *array; unsigned short *array;
...@@ -11,10 +11,10 @@ struct semun { ...@@ -11,10 +11,10 @@ struct semun {
int semctl(int id, int num, int cmd, ...) int semctl(int id, int num, int cmd, ...)
{ {
struct semun arg; union semun arg;
va_list ap; va_list ap;
va_start(ap, cmd); va_start(ap, cmd);
arg = va_arg(ap, struct semun); arg = va_arg(ap, union semun);
va_end(ap); va_end(ap);
#ifdef SYS_semctl #ifdef SYS_semctl
return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf); return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册