open(2) needs a mode argument when O_CREAT is specified.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 27 Feb 2008 15:34:28 +0000 (15:34 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 27 Feb 2008 15:34:28 +0000 (15:34 +0000)
(Closes issue #12083)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104534 65c4cc65-6c06-0410-ace0-fbb531ad65f3

utils/astcanary.c

index eb9f172..785ec14 100644 (file)
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
                /* Update the modification times (checked from Asterisk) */
                if (utime(argv[1], NULL)) {
                        /* Recreate the file if it doesn't exist */
-                       if ((fd = open(argv[1], O_RDWR | O_TRUNC | O_CREAT)) > -1)
+                       if ((fd = open(argv[1], O_RDWR | O_TRUNC | O_CREAT, 0777)) > -1)
                                close(fd);
                        else
                                exit(1);