Fixed file permissions for new ELF object files.

master
James T. Martin 2022-05-18 13:56:58 -07:00
parent ef72003049
commit a922cb9912
Signed by: james
GPG Key ID: 4B7F3DA9351E577C
1 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#ifndef align_up
@ -64,8 +65,13 @@ int main(int argc, char** argv) {
close(blob_fd);
// only write is needed, but mmap requires O_RDWR
int output_fd = open(output_file_name, O_RDWR | O_CREAT | O_TRUNC);
int output_fd =
open(
output_file_name,
// only write is needed, but mmap requires O_RDWR
O_RDWR | O_CREAT | O_TRUNC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
);
if (output_fd < 0) {
fprintf(
stderr,