OSDN Git Service

mkostemp: fix implementation
[uclinux-h8/uClibc.git] / test / stdlib / test-mkostemp-child.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4
5 int main(int argc, char *argv[]) {
6     int fd;
7
8     /* This file gets built and run as a test, but its
9      * really just a helper for test-mkostemp-O_CLOEXEC.c.
10      * So, we'll always return succcess.
11      */
12     if(argc != 2)
13         exit(EXIT_SUCCESS);
14
15     sscanf(argv[1], "%d", &fd);
16
17     if(write(fd, "test\0", 5) == -1)
18         ; /* Don't Panic!  Failure is okay here. */
19
20     close(fd);
21     exit(EXIT_SUCCESS);
22 }