Skip to content

Commit

Permalink
fix(mosq): Use sock_utils instead of func stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Dec 20, 2024
1 parent 95294f5 commit 3cd0ed3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 59 deletions.
5 changes: 2 additions & 3 deletions components/mosquitto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,15 @@ idf_component_register(SRCS ${m_srcs}
port/callbacks.c
port/config.c
port/signals.c
port/ifaddrs.c
port/broker.c
port/files.c
port/net__esp_tls.c
port/sysconf.c
PRIV_INCLUDE_DIRS port/priv_include port/priv_include/sys ${m_dir} ${m_src_dir}
${m_incl_dir} ${m_lib_dir} ${m_deps_dir}
INCLUDE_DIRS ${m_incl_dir} port/include
REQUIRES esp-tls
PRIV_REQUIRES newlib
)
PRIV_REQUIRES newlib sock_utils)

target_compile_definitions(${COMPONENT_LIB} PRIVATE "WITH_BROKER")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
Expand Down
2 changes: 2 additions & 0 deletions components/mosquitto/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ url: https://github.com/espressif/esp-protocols/tree/master/components/mosquitto
description: The component provides a simple ESP32 port of mosquitto broker
dependencies:
idf: '>=5.1'
espressif/sock_utils:
version: '^0.2'
20 changes: 0 additions & 20 deletions components/mosquitto/port/ifaddrs.c

This file was deleted.

13 changes: 2 additions & 11 deletions components/mosquitto/port/priv_include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@
*/
#pragma once
#include <ctype.h>
#include "net/if.h"

#undef isspace
#define isspace(__c) (__ctype_lookup((int)__c)&_S)

#include_next "config.h"
#define VERSION "v2.0.18~0"

#define _SC_OPEN_MAX_OVERRIDE 4

// used to override syscall for obtaining max open fds
static inline long sysconf(int arg)
{
if (arg == _SC_OPEN_MAX_OVERRIDE) {
return 64;
}
return -1;
}
#define VERSION "v2.0.20~1"
17 changes: 0 additions & 17 deletions components/mosquitto/port/priv_include/ifaddrs.h

This file was deleted.

8 changes: 0 additions & 8 deletions components/mosquitto/port/priv_include/poll.h

This file was deleted.

18 changes: 18 additions & 0 deletions components/mosquitto/port/sysconf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ctype.h>
#include <unistd.h>

#define _SC_OPEN_MAX_OVERRIDE 4

// used to override syscall for obtaining max open fds
long sysconf(int arg)
{
if (arg == _SC_OPEN_MAX_OVERRIDE) {
return 64;
}
return -1;
}

0 comments on commit 3cd0ed3

Please sign in to comment.