diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-08-30 18:51:20 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-10-06 15:27:14 +0000 |
| commit | 4aa4fcfa83a7866ce1868465b473239326f92c7c (patch) | |
| tree | 65623505a450881bc9fb0a499fad1e04d743aae7 /test/integration | |
| parent | a9d40153f823bb1f4e1103d760f5d117d679c35b (diff) | |
fix compiling with musl
In case apt is compiled against musl-libc, then compilation fails with the
following error:
cmdline/apt-internal-solver.cc:122:20: error: 'basename' was not declared in this scope; did you mean 'rename'?
| 122 | if (strcmp(basename(argv[0]), "solver3") == 0)
| | ^~~~~~~~
| | rename
To fix it, include libgen header where musl can find this function also.
Once this is fixed, compilation fails once again with musl-libc, because
the basename function takes *char argument instead of const *char:
this is because the musl implementation cuts off the trailing slashes
of the path, in case the argument is a folder path.
To account for this, instead of passing argv[0] directly, create a non-const
string copy of it, and pass that to base.
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'test/integration')
0 files changed, 0 insertions, 0 deletions
