mirror of
https://github.com/github/codeql.git
synced 2026-04-19 22:14:01 +02:00
22 lines
241 B
C
22 lines
241 B
C
char *file_name;
|
|
int fd;
|
|
|
|
/* Initialize file_name */
|
|
|
|
fd = open(
|
|
file_name,
|
|
O_WRONLY | O_CREAT | O_EXCL,
|
|
S_IRWXU
|
|
);
|
|
if (fd == -1) {
|
|
/* Handle error */
|
|
}
|
|
|
|
/* ... */
|
|
|
|
if (fchmod(fd, S_IRUSR) == -1) {
|
|
/* Handle error */
|
|
}
|
|
|
|
close(fd);
|