unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#25923: pkgsrc patches: improve mkostemp support
@ 2017-03-01 20:29 Thomas Klausner
  2017-03-14 11:32 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Klausner @ 2017-03-01 20:29 UTC (permalink / raw)
  To: 25923; +Cc: Greg Troxel

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

And the final pkgsrc patch tries to use only the flags for mkostemp
that are supported on the operating system, in particular for Darwin
and NetBSD.

Please merge this one as well.

Thanks,
 Thomas

[-- Attachment #2: patch-libguile_filesys.c --]
[-- Type: text/plain, Size: 933 bytes --]

$NetBSD: patch-libguile_filesys.c,v 1.3 2017/02/21 15:55:28 gdt Exp $

When using mkostemp (an interface not defined by POSIX), restrict
flags to the set defined by the documentation of particular operating
systems.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23 for discussion.

This patch has not yet been sent upstream.

--- libguile/filesys.c.orig	2016-12-15 00:03:33.000000000 +0000
+++ libguile/filesys.c
@@ -1486,6 +1486,15 @@ SCM_DEFINE (scm_i_mkstemp, "mkstemp!", 1
       mode_bits = scm_i_mode_bits (mode);
     }
 
+#ifdef __APPLE__
+  /* https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23 */
+  open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC;
+#endif
+#ifdef __NetBSD__
+  /* Restrict to list of flags documented in man page. */
+  open_flags &= O_APPEND|O_DIRECT|O_SHLOCK|O_EXLOCK|O_SYNC|O_CLOEXEC;
+#endif
+
   SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
   if (rv == -1)
     SCM_SYSERROR;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#25923: pkgsrc patches: improve mkostemp support
  2017-03-01 20:29 bug#25923: pkgsrc patches: improve mkostemp support Thomas Klausner
@ 2017-03-14 11:32 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2017-03-14 11:32 UTC (permalink / raw)
  To: Thomas Klausner; +Cc: 25923-done

On Wed 01 Mar 2017 21:29, Thomas Klausner <tk@giga.or.at> writes:

> --- libguile/filesys.c.orig	2016-12-15 00:03:33.000000000 +0000
> +++ libguile/filesys.c
> @@ -1486,6 +1486,15 @@ SCM_DEFINE (scm_i_mkstemp, "mkstemp!", 1
>        mode_bits = scm_i_mode_bits (mode);
>      }
>  
> +#ifdef __APPLE__
> +  /* https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23 */
> +  open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC;
> +#endif
> +#ifdef __NetBSD__
> +  /* Restrict to list of flags documented in man page. */
> +  open_flags &= O_APPEND|O_DIRECT|O_SHLOCK|O_EXLOCK|O_SYNC|O_CLOEXEC;
> +#endif
> +
>    SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
>    if (rv == -1)
>      SCM_SYSERROR;

I believe this was fixed in 2.1.6 as well so you can drop this one too.

Cheers,

Andy





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-14 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 20:29 bug#25923: pkgsrc patches: improve mkostemp support Thomas Klausner
2017-03-14 11:32 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).