Skip to content

Commit

Permalink
Merge branch 'simplify' of https://github.com/ikspress/util-linux
Browse files Browse the repository at this point in the history
* 'simplify' of https://github.com/ikspress/util-linux:
  meson: simplify code
  ipcrm: simplify code
  • Loading branch information
karelzak committed Aug 22, 2024
2 parents 5225bda + 20d2d38 commit d98a17d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
9 changes: 5 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ login_lastlogin = get_option('login-lastlogin')
conf.set('USE_LOGIN_LASTLOG', login_lastlogin ? 1 : false)
summary('login-lastlogin', login_lastlogin ? 'enabled' : 'disabled', section : 'components')

have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0
have_mountfd_api = cc.has_type('struct mount_attr', prefix : '#include <linux/mount.h>')
conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)

have_struct_statx = cc.sizeof('struct statx', prefix : '#include <sys/stat.h>') > 0
have_struct_statx = cc.has_type('struct statx', prefix : '#include <sys/stat.h>')
conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 1 : false)

have_sys_vfs_header = cc.has_header('sys/vfs.h')
Expand Down Expand Up @@ -474,7 +474,8 @@ conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
have = cc.has_function('strsignal')
conf.set10('HAVE_STRSIGNAL_DECL', have)

have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
have = cc.has_type('union semun',
prefix : '#include <sys/sem.h>')
conf.set('HAVE_UNION_SEMUN', have ? 1 : false)

have = cc.has_type('loff_t',
Expand Down Expand Up @@ -674,7 +675,7 @@ conf.set('HAVE_TM_GMTOFF', have ? 1 : false)



have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
have = cc.has_type('enum fsconfig_command', prefix : '#include <linux/mount.h>')
conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)

have = cc.has_member('struct termios', 'c_line',
Expand Down
21 changes: 1 addition & 20 deletions sys-utils/ipcrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/types.h>
#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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d98a17d

Please sign in to comment.