Fix incorrect mapping of fopen mode 'a' in recently-added code to
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 24 Sep 2006 17:19:53 +0000 (17:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 24 Sep 2006 17:19:53 +0000 (17:19 +0000)
make fopen work safely on Windows.  Magnus

src/port/open.c

index a27fafe11620f0d15714b500c13c7357ee982d01..b869e9f8e9e55b98568f759ad52a4f7fcd30805c 100644 (file)
@@ -126,7 +126,7 @@ pgwin32_fopen(const char *fileName, const char *mode)
        else if (strchr(mode, 'w'))
                openmode |= O_WRONLY | O_CREAT | O_TRUNC;
        if (strchr(mode, 'a'))
-               openmode |= O_WRONLY | O_APPEND;
+               openmode |= O_WRONLY | O_CREAT | O_APPEND;
 
        if (strchr(mode, 'b'))
                openmode |= O_BINARY;