Fix building on newer systems which require a third arg to open() when using O_CREAT.

Issue 11238, reported by puzzled.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Jason Parker 18 years ago
parent b0e9d400ff
commit fb0bb38fc4

@ -1569,7 +1569,7 @@ static int try_firmware(char *s)
ast_log(LOG_WARNING, "Cannot open '%s': %s\n", s, strerror(errno));
return -1;
}
fd = open(s2, O_RDWR | O_CREAT | O_EXCL);
fd = open(s2, O_RDWR | O_CREAT | O_EXCL, 0600);
if (fd < 0) {
ast_log(LOG_WARNING, "Cannot open '%s' for writing: %s\n", s2, strerror(errno));
close(ifd);

@ -9479,7 +9479,7 @@ static int handle_pri_set_debug_file(int fd, int argc, char **argv)
if (ast_strlen_zero(argv[4]))
return RESULT_SHOWUSAGE;
myfd = open(argv[4], O_CREAT|O_WRONLY);
myfd = open(argv[4], O_CREAT|O_WRONLY, 0600);
if (myfd < 0) {
ast_cli(fd, "Unable to open '%s' for writing\n", argv[4]);
return RESULT_SUCCESS;

Loading…
Cancel
Save