pkgsrc/multimedia/vlc2/patches/patch-modules_misc_gnutls.c
marino 726f622c65 multimedia/vlc2: only use O_RDONLY and O_DIRECTORY if supported
DragonFly's file control options aren't fully posix-compliant yet, and
the O_DIRECTORY flag hasn't been implemented (all the flag spots are full
and old ones need to be recycled).

These patches adds additional support checks for each fcntl flag used with
vlc_open and vlc_openat and only sets the supported one.  There is no need
to revbump because any platform requiring this check couldn't have built.
2012-07-29 17:37:57 +00:00

24 lines
856 B
C

$NetBSD: patch-modules_misc_gnutls.c,v 1.1 2012/07/29 17:37:58 marino Exp $
Mainly due to lack of bits for new fcntl flags, O_DIRECTORY isn't currently
supported by DragonFly's open. This patch checks which flags are supported
before passing them to vlc_open.
--- modules/misc/gnutls.c.orig 2012-01-27 18:24:46.000000000 +0000
+++ modules/misc/gnutls.c
@@ -469,7 +469,14 @@ static void gnutls_Addx509Directory (vlc
const char *path, bool priv)
{
msg_Dbg (obj, "browsing x509 credentials in %s...", path);
- int fd = vlc_open (path, O_RDONLY|O_DIRECTORY);
+ int flags = 0;
+#ifdef O_RDONLY
+ flags |= O_RDONLY;
+#endif
+#ifdef O_DIRECTORY
+ flags |= O_DIRECTORY;
+#endif
+ int fd = vlc_open (path, flags);
if (fd == -1)
{
msg_Warn (obj, "cannot access x509 in %s: %m", path);