Files
cryptsetup/tests/fake_systemd_tpm_path.c
Milan Broz 5186f49613 tests: fix compilation warnings with C18
Fix the function prototype and define GNU source definition to get strdup().
2022-11-13 19:40:50 +01:00

18 lines
319 B
C

#include <string.h>
#include <stdlib.h>
/* systemd tpm2-util.h */
int tpm2_find_device_auto(int log_level, char **ret);
extern int tpm2_find_device_auto(int log_level __attribute__((unused)), char **ret)
{
const char *path = getenv("TPM_PATH");
if (!path)
*ret = NULL;
else
*ret = strdup(path);
return 0;
}