summaryrefslogtreecommitdiff
path: root/devel/gettext/patches/patch-gettext-tools_src_write-mo.c
blob: 48fcb6bb3c3131abb80dcfc81eff65c56b402b7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$NetBSD: patch-gettext-tools_src_write-mo.c,v 1.1 2020/08/12 23:31:09 joerg Exp $

Workaround for /dev/null failing with O_TRUNC|O_WRONLY in Illumos zones.

--- gettext-tools/src/write-mo.c.orig	2020-07-05 22:39:41.000000000 +0000
+++ gettext-tools/src/write-mo.c
@@ -809,6 +809,9 @@ msgdomain_write_mo (message_list_ty *mlp
              (through SIGSEGV or SIGBUS).  */
           struct supersede_final_action action;
           FILE *output_file =
+#ifdef __sun__
+            strcmp(file_name, "/dev/null") == 0 ? fopen (file_name, "wb") :
+#endif
             fopen_supersede (file_name, "wb", true, true, &action);
           if (output_file == NULL)
             {