Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / test / make-binary-wrapper / env.c
blob7e0422dee3bdc0a0b563f1573c1d954bdb3fd106
1 #include <unistd.h>
2 #include <stdlib.h>
3 #include <stdio.h>
5 #define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)
7 int main(int argc, char **argv) {
8 putenv("PART1=HELLO");
9 assert_success(setenv("PART2", "WORLD", 0));
10 assert_success(unsetenv("SOME_OTHER_VARIABLE"));
11 putenv("PART3=\"!!\n\"");
12 argv[0] = "/send/me/flags";
13 return execv("/send/me/flags", argv);