#include <string.h>
#include <unistd.h>
+#include "example.h"
#include "../src/compiler.h"
printf("\nCHECKING COLORING.\n\n");
fflush(stdout);
- dup2(2, 3);
+ xdup2(2, 3);
char *args[] = { argv0, NULL };
char *envp[] = { ldpreload, NULL };
execve(argv[0], args, envp);
return EXIT_FAILURE;
} else if (!skip--) {
- dup2(2, 4);
+ xdup2(2, 4);
execl(argv[0], argv0, NULL);
return EXIT_FAILURE;
} else if (!skip--) {
- dup2(2, 5);
+ xdup2(2, 5);
execlp(argv[0], argv0, NULL);
return EXIT_FAILURE;
} else if (!skip--) {
- dup2(2, 6);
+ xdup2(2, 6);
char *envp[] = { ldpreload, NULL };
execle(argv[0], argv0, NULL, envp);
return EXIT_FAILURE;
} else if (!skip--) {
- dup2(2, 7);
+ xdup2(2, 7);
/* Test closing a few descriptors. */
close(5);
execv(argv[0], args);
return EXIT_FAILURE;
} else if (!skip--) {
- dup2(2, 8);
+ xdup2(2, 8);
/* And a few more. */
close(7);
close(3);
close(8);
- dup2(2, 5);
+ xdup2(2, 5);
char *args[] = { argv0, NULL };
char *envp[] = { ldpreload, "COLORED_STDERR_FDS=5,", NULL };
char *args[] = { argv0, NULL };
char *envp[] = { ldpreload, NULL };
- dup2(5, 6);
+ xdup2(5, 6);
close(5);
execve(argv[0], args, envp);