mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
228d451e03
On macOS, /tmp is a symlink to /private/tmp. When performing cd /tmp, and checking cwd - it won't match since it follows the symlink. This caused test breakage on macOS but not Linux. Instead, use a folder which is not a symlink, and consistent across Linux and macOS.
12 lines
292 B
C
12 lines
292 B
C
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)
|
|
|
|
int main(int argc, char **argv) {
|
|
assert_success(chdir("./tmp/foo"));
|
|
argv[0] = "/send/me/flags";
|
|
return execv("/send/me/flags", argv);
|
|
}
|