diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:21 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:48 +0100 |
commit | 048a4cd441a59cbf89defb18bb45c9f0b4429b35 (patch) | |
tree | f8f5850ff05521ab82d65745894714a8796cbfb6 /pkgs/tools/system/dell-command-configure/wrapper-lib.c | |
parent | 030c5028b07afcedce7c5956015c629486cc79d9 (diff) | |
parent | 4c2d05dd6435d449a3651a6dd314d9411b5f8146 (diff) | |
download | nixpkgs-rootfs.tar nixpkgs-rootfs.tar.gz nixpkgs-rootfs.tar.bz2 nixpkgs-rootfs.tar.lz nixpkgs-rootfs.tar.xz nixpkgs-rootfs.tar.zst nixpkgs-rootfs.zip |
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/tools/system/dell-command-configure/wrapper-lib.c')
-rwxr-xr-x | pkgs/tools/system/dell-command-configure/wrapper-lib.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/tools/system/dell-command-configure/wrapper-lib.c b/pkgs/tools/system/dell-command-configure/wrapper-lib.c new file mode 100755 index 00000000000..f93bcd58ab7 --- /dev/null +++ b/pkgs/tools/system/dell-command-configure/wrapper-lib.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <string.h> + +static const char from[] = "/usr/lib/ext/dell/omreg.cfg"; +static const char to[] = "@to@"; + +int access_wrapper(const char *fn, int mode) +{ + if (!strcmp(fn, from)) { + printf("access_wrapper.c: Replacing path '%s' with '%s'\n", from, to); + fn = to; + } + return access(fn, mode); +} + +FILE* fopen_wrapper(const char* fn, const char* mode) +{ + if (!strcmp(fn, from)) { + printf("fopen_wrapper.c: Replacing path '%s' with '%s'\n", from, to); + fn = to; + } + return fopen(fn, mode); +} |