From: Yang Kun <91833768+ikspress@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:38:15 +0000 (+0800) Subject: ipcrm: simplify code X-Git-Tag: v2.42-start~233^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ffd9710559415baec7161f80ea3041a846dbbfe6;p=thirdparty%2Futil-linux.git ipcrm: simplify code --- diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c index d417c5593..26255c494 100644 --- a/sys-utils/ipcrm.c +++ b/sys-utils/ipcrm.c @@ -19,25 +19,13 @@ #include #include #include -#include -#include -#include -#include #include #include "c.h" #include "nls.h" #include "strutils.h" #include "closestream.h" -#ifndef HAVE_UNION_SEMUN -/* according to X/OPEN we have to define it ourselves */ -union semun { - int val; - struct semid_ds *buf; - unsigned short int *array; - struct seminfo *__buf; -}; -#endif +#include "ipcutils.h" typedef enum type_id { SHM, @@ -281,13 +269,6 @@ static int remove_all(type_id type) ret |= remove_id(SEM, 0, rm_me); } } -/* kFreeBSD hackery -- ah 20140723 */ -#ifndef MSG_STAT -#define MSG_STAT 11 -#endif -#ifndef MSG_INFO -#define MSG_INFO 12 -#endif if (type == MSG || type == ALL) { maxid = msgctl(0, MSG_INFO, (struct msqid_ds *)(void *)&msginfo);