Skip to content

Commit

Permalink
tini: fix missing basename
Browse files Browse the repository at this point in the history
Fix issue: openwrt/packages#23934
Patch from: https://git.alpinelinux.org/aports/tree/community/tini/fix-missing-basename.patch

It solves the error: implicit declaration of function 'basename' with musl libc 1.2.5

Signed-off-by: Andrea Pesaresi <[email protected]>
  • Loading branch information
pesa1234 authored and ptpt52 committed Dec 16, 2024
1 parent d294dfb commit b447712
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utils/tini/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=tini
PKG_VERSION:=0.19.0
PKG_RELEASE:=2
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/krallin/tini/tar.gz/v${PKG_VERSION}?
Expand Down
11 changes: 11 additions & 0 deletions utils/tini/patches/002-fix_missing_basename.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/tini.c
+++ b/src/tini.c
@@ -18,6 +18,8 @@
#include "tiniConfig.h"
#include "tiniLicense.h"

+#define basename(name) (strrchr((name),'/') ? strrchr((name),'/')+1 : (name))
+
#if TINI_MINIMAL
#define PRINT_FATAL(...) fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");
#define PRINT_WARNING(...) if (verbosity > 0) { fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); }

0 comments on commit b447712

Please sign in to comment.