Browse Source

try other workaround for alpine musl

build Release_2.0.8.RC8
Claudio Luck 9 months ago
parent
commit
c9e55a5fea
2 changed files with 16 additions and 6 deletions
  1. +6
    -1
      src/launcher/GNUmakefile
  2. +10
    -5
      src/launcher/install.run.c

+ 6
- 1
src/launcher/GNUmakefile View File

@ -7,5 +7,10 @@ MACOSX_DEPLOYMENT_TARGET=10.11
export MACOSX_DEPLOYMENT_TARGET
endif
all: install.run
all: info install.run
info:
-@apk info musl
.PHONY: info

+ 10
- 5
src/launcher/install.run.c View File

@ -40,12 +40,12 @@ int main(int argc, char *argv[])
*/
if (argv[0][0] == '.' && argv[0][1] == '/')
{
realpath(".", prog);
getcwd (prog, pathmax);
if (errno)
FAILED("realpath")
FAILED("getcwd")
pathlen = strlen(prog);
if (pathmax - pathlen <= 2)
ERROUT(1, "cwd too long")
ERROUT(1, "working directory path too long")
if (stpncpy(&prog[pathlen], &argv[0][1], pathmax - pathlen + 1)
>= &prog[pathmax + 1])
ERROUT(1, "cwd+argv[0] string too long");
@ -53,8 +53,13 @@ int main(int argc, char *argv[])
else
{
realpath (argv[0], prog);
if (errno)
FAILED("realpath");
if (errno && errno != 22)
FAILED("realpath")
else if (errno)
{
fprintf (stderr, "realpath() FAILED, 22: %s (ignoring error)\n", argv[0]);
strncpy (prog, argv[0], pathmax);
}
}
strncpy(xdg, prog, pathmax);
char * progdir_end = strrchr(prog, '/');


Loading…
Cancel
Save