10000 remove sys_rel_get and epoll_check by alfredh · Pull Request #335 · baresip/re · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

remove sys_rel_get and epoll_check #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
list(APPEND SRCS
src/net/linux/rt.c
src/main/epoll.c
)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
list(APPEND SRCS
Expand Down
2 changes: 0 additions & 2 deletions include/re_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#endif

struct re_printf;
int sys_rel_get(uint32_t *rel, uint32_t *maj, uint32_t *min,
uint32_t *patch);
int sys_kernel_get(struct re_printf *pf, void *unused);
int sys_build_get(struct re_printf *pf, void *unused);
const char *sys_arch_get(void);
Expand Down
47 changes: 0 additions & 47 deletions src/main/epoll.c

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,6 @@ int poll_method_set(enum poll_method method)
#endif
#ifdef HAVE_EPOLL
case METHOD_EPOLL:
if (!epoll_check())
return EINVAL;
break;
#endif
#ifdef HAVE_KQUEUE
Expand Down
5 changes: 0 additions & 5 deletions src/main/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
*/


#ifdef HAVE_EPOLL
bool epoll_check(void);
#endif


#ifdef __cplusplus
extern "C" {
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/main/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ enum poll_method poll_method_best(void)
#ifdef HAVE_EPOLL
/* Supported from Linux 2.5.66 */
if (METHOD_NULL == m) {
if (epoll_check())
m = METHOD_EPOLL;
m = METHOD_EPOLL;
}
#endif

Expand Down
4 changes: 0 additions & 4 deletions src/main/mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ SRCS += main/init.c
SRCS += main/main.c
SRCS += main/method.c

ifneq ($(HAVE_EPOLL),)
SRCS += main/epoll.c
endif

ifneq ($(USE_OPENSSL),)
SRCS += main/openssl.c
endif
51 changes: 0 additions & 51 deletions src/sys/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,57 +22,6 @@
#endif


/**
* Get system release version
*
* @param rel Binary encoded release
* @param maj Major version number
* @param min Minor version number
* @param patch Patch number
*
* @return 0 if success, otherwise errorcode
*/
int sys_rel_get(uint32_t *rel, uint32_t *maj, uint32_t *min, uint32_t *patch)
{
#ifdef HAVE_UNAME
struct utsname u;
struct pl pl_mj, pl_mn, pl_p;
uint32_t mj, mn, p;
int err;

if (0 != uname(&u))
return errno;

err = re_regex(u.release, strlen(u.release),
"[0-9]+.[0-9]+[.\\-]1[0-9]+",
&pl_mj, &pl_mn, NULL, &pl_p);
if (err)
return err;

mj = pl_u32(&pl_mj);
mn = pl_u32(&pl_mn);
p = pl_u32(&pl_p);

if (rel)
*rel = mj<<16 | mn<<8 | p;
if (maj)
*maj = mj;
if (min)
*min = mn;
if (patch)
*patch = p;

return 0;
#else
(void)rel;
(void)maj;
(void)min;
(void)patch;
return EINVAL;
#endif
}


/**
* Get kernel name and version
*
Expand Down
0