Skip to content

tr181: add missing include in deviceinfo.c

Roman Azarenko requested to merge roman-deviceinfo-include-devel into devel

Building on vanilla OpenWrt fails with the following error:

[3/38] Building C object libbbfdm/CMakeFiles/bbfdm.dir/dmtree/tr181/deviceinfo.c.o
FAILED: libbbfdm/CMakeFiles/bbfdm.dir/dmtree/tr181/deviceinfo.c.o
/home/dev/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-13.2.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc -DBBF_TR143 -DBBF_TR181 -DBBF_TR471 -DBBF_VENDOR_PREFIX=\"X_IOPSYS_EU_\" -DBBF_WIFI_DATAELEMENTS -D_GNU_SOURCE -Dbbfdm_EXPORTS  -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -fmacro-prefix-map=/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9=bbfdm-1.8.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9 -I/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm -I/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree -I/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree/tr181 -I/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree/tr143 -I/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree/tr471 -DNDEBUG -fPIC   -Wall -Werror -MD -MT libbbfdm/CMakeFiles/bbfdm.dir/dmtree/tr181/deviceinfo.c.o -MF libbbfdm/CMakeFiles/bbfdm.dir/dmtree/tr181/deviceinfo.c.o.d -o libbbfdm/CMakeFiles/bbfdm.dir/dmtree/tr181/deviceinfo.c.o -c /home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree/tr181/deviceinfo.c
/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree/tr181/deviceinfo.c: In function 'procps_get_cmdline':
/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree/tr181/deviceinfo.c:212:24: error: implicit declaration of function 'basename' [-Werror=implicit-function-declaration]
  212 |                 base = basename(buf); /* before we replace argv0's NUL with space */
      |                        ^~~~~~~~
/home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/libbbfdm/dmtree/tr181/deviceinfo.c:212:22: error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
  212 |                 base = basename(buf); /* before we replace argv0's NUL with space */
      |                      ^
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.
make[2]: *** [Makefile:163: /home/dev/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/bbfdm-1.8.9/.built] Error 1

This MR fixes the errors above by adding the missing libgen.h include.

Merge request reports