sahlberg / libsmb2

SMB2/3 userspace client
Other
322 stars 134 forks source link

ESP_PLATFORM is sys/poll.h, not poll.h. #290

Closed nopnop2002 closed 9 months ago

nopnop2002 commented 9 months ago

Thanks for your code, it is very much appreciated!

Updated to the latest version from v4.0.0. The following error occurs. ESP_PLATFORM has HAVE_POLL_H defined, but in sys/poll.h instead of poll.h.

$ idf.py --version
ESP-IDF v5.0.2-392-ga7ab77663a

$ cd $HOME
$ git clone https://github.com/nopnop2002/esp-idf-smb-client
$ cd esp-idf-smb-client
$ git clone https://github.com/sahlberg/libsmb2 components/libsmb2
$ cd smb2-ls
$ idf.py build
/home/nop/rtos/esp-idf-smb-client/components/libsmb2/lib/sync.c:45:10: fatal error: poll.h: No such file or directory
   45 | #include <poll.h>
      |          ^~~~~~~~
compilation terminated.

V4.0.0 sync.c and socket.c

#include <errno.h>
#if defined(HAVE_POLL_H) || defined(_WINDOWS)
#ifdef ESP_PLATFORM
#include <sys/poll.h>
#else
#include <poll.h>
#endif
#endif

Latest sync.c and socket.c

#include <errno.h>

#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif

#ifdef HAVE_POLL_H
#include <poll.h>
#endif

https://github.com/sahlberg/libsmb2/pull/291

$ cd $HOME
$ git clone https://github.com/nopnop2002/esp-idf-smb-client
$ cd esp-idf-smb-client
$ git clone https://github.com/nopnop2002/libsmb2 components/libsmb2
$ cd smb2-ls
$ idf.py build

Project build complete. To flash, run this command:
/home/nop/.espressif/python_env/idf5.1_py3.8_env/bin/python ../../../esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32c6  write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/smb2-ls.bin
or run 'idf.py -p (PORT) flash'
Wolf3s commented 9 months ago

i created a pull request that don´t mess the HAVE_POLL_H header: https://github.com/nopnop2002/libsmb2/pull/1

nopnop2002 commented 9 months ago

Your PR is work fine.

Wolf3s commented 9 months ago

Your PR is work fine.

Thanks, also try to do request again, if you want

nopnop2002 commented 9 months ago

https://github.com/sahlberg/libsmb2/pull/292