From 501ea8f48fa40ec80284ec62f8da1830e2c635aa Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 7 Nov 2007 11:44:43 +0000 Subject: [PATCH] Fix open() call. --- gettext-tools/src/ChangeLog | 5 +++++ gettext-tools/src/write-catalog.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 6d33fd6f4..500e65ced 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,8 @@ +2007-11-07 Jim Meyering + Bruno Haible + + * write-catalog.c (msgdomain_list_print): Fix open() call. + 2007-11-07 Bruno Haible * gettext-0.17 released. diff --git a/gettext-tools/src/write-catalog.c b/gettext-tools/src/write-catalog.c index 0447744e3..635f8c136 100644 --- a/gettext-tools/src/write-catalog.c +++ b/gettext-tools/src/write-catalog.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -220,7 +220,9 @@ message catalog has plural form translations, but the output format does not sup /* Open the output file. */ if (!to_stdout) { - fd = open (filename, O_WRONLY | O_CREAT); + fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, + /* 0666 in portable POSIX notation: */ + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd < 0) { const char *errno_description = strerror (errno); -- 2.47.3