Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at python-updates 24 lines 537 B view raw
1#include <stdio.h> 2#include <string.h> 3#include <unistd.h> 4 5static const char from[] = "/usr/lib/ext/dell/omreg.cfg"; 6static const char to[] = "@to@"; 7 8int access_wrapper(const char *fn, int mode) 9{ 10 if (!strcmp(fn, from)) { 11 printf("access_wrapper.c: Replacing path '%s' with '%s'\n", from, to); 12 fn = to; 13 } 14 return access(fn, mode); 15} 16 17FILE* fopen_wrapper(const char* fn, const char* mode) 18{ 19 if (!strcmp(fn, from)) { 20 printf("fopen_wrapper.c: Replacing path '%s' with '%s'\n", from, to); 21 fn = to; 22 } 23 return fopen(fn, mode); 24}