diff options
author | marino <marino@pkgsrc.org> | 2012-07-29 17:37:57 +0000 |
---|---|---|
committer | marino <marino@pkgsrc.org> | 2012-07-29 17:37:57 +0000 |
commit | b5982fafa7d59cf4c0084c8fe3bd8589935ed59a (patch) | |
tree | f7d16ae62075ce2c1ebceb155d909576cd923d91 /multimedia | |
parent | 696883e6d22df647dc769554dcf867a0c158bd7a (diff) | |
download | pkgsrc-b5982fafa7d59cf4c0084c8fe3bd8589935ed59a.tar.gz |
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.
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/vlc2/distinfo | 4 | ||||
-rw-r--r-- | multimedia/vlc2/patches/patch-modules_access_directory.c | 25 | ||||
-rw-r--r-- | multimedia/vlc2/patches/patch-modules_misc_gnutls.c | 24 |
3 files changed, 52 insertions, 1 deletions
diff --git a/multimedia/vlc2/distinfo b/multimedia/vlc2/distinfo index 3cf251fb33d..37018665b12 100644 --- a/multimedia/vlc2/distinfo +++ b/multimedia/vlc2/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.7 2012/07/24 18:40:42 drochner Exp $ +$NetBSD: distinfo,v 1.8 2012/07/29 17:37:57 marino Exp $ SHA1 (vlc-2.0.3.tar.xz) = 9f161d997eae613bc6431bcb2459e1aefad8d529 RMD160 (vlc-2.0.3.tar.xz) = 7d4498c21676a9221ef0b632cb454584c9986e16 @@ -9,7 +9,9 @@ SHA1 (patch-as) = b53b074b2791d7bf69d5f09c7c32d873608f3086 SHA1 (patch-at) = bf48ded3571358d6b718af47b28804c3155d84ef SHA1 (patch-au) = 5ea53969efefe3d9a6e3121b5453b573c633124b SHA1 (patch-av) = c82b711947ea4bdca9b011e36af6c87d9b6f62a6 +SHA1 (patch-modules_access_directory.c) = e36df1da5b788e12e9fc7d94663dd69d86fe4f7a SHA1 (patch-modules_access_rtp_Modules.am) = 14aea82ffab2fcfa5b0916ac2e86363d1efdcbf3 SHA1 (patch-modules_audio__output_pulse.c) = 941ee669e62c9d757fc096c74a2aec58cf265b15 +SHA1 (patch-modules_misc_gnutls.c) = 7ab9df9f8b31ea7a7c8e302876d0e6c4e6882c30 SHA1 (patch-skins-aa) = 9477b095b3e0a1120397c6c9f7102a50c1a63d2b SHA1 (patch-skins-ab) = bf8b3e33db5389dbf04dfedf1d2f1d120afed66a diff --git a/multimedia/vlc2/patches/patch-modules_access_directory.c b/multimedia/vlc2/patches/patch-modules_access_directory.c new file mode 100644 index 00000000000..0c44b021408 --- /dev/null +++ b/multimedia/vlc2/patches/patch-modules_access_directory.c @@ -0,0 +1,25 @@ +$NetBSD: patch-modules_access_directory.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 openat. This patch checks which flags are supported +before passing them to vlc_openat. + +--- modules/access/directory.c.orig 2012-06-20 18:07:49.000000000 +0000 ++++ modules/access/directory.c +@@ -309,8 +309,14 @@ block_t *DirBlock (access_t *p_access) + { + DIR *handle; + #ifdef HAVE_OPENAT +- int fd = vlc_openat (dirfd (current->handle), entry, +- O_RDONLY | O_DIRECTORY); ++ int flags = 0; ++#ifdef O_RDONLY ++ flags |= O_RDONLY; ++#endif ++#ifdef O_DIRECTORY ++ flags |= O_DIRECTORY; ++#endif ++ int fd = vlc_openat (dirfd (current->handle), entry, flags); + if (fd == -1) + { + if (errno == ENOTDIR) diff --git a/multimedia/vlc2/patches/patch-modules_misc_gnutls.c b/multimedia/vlc2/patches/patch-modules_misc_gnutls.c new file mode 100644 index 00000000000..8c34f191165 --- /dev/null +++ b/multimedia/vlc2/patches/patch-modules_misc_gnutls.c @@ -0,0 +1,24 @@ +$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); |