summaryrefslogtreecommitdiffstats
path: root/tests/bugs/access-control/bug-1387241.c
blob: e2e843a2fda639b1d8303f1ea24e1e9c99af3d1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

int
main(int argc, char *argv[])
{
    int ret = EXIT_FAILURE;
    int fd = open(argv[1], O_RDONLY | O_TRUNC);

    if (fd) {
        ret = EXIT_SUCCESS;
        close(fd);
    }

    return ret;
}