Fix build on SunOS (no dirent->d_type).

This commit is contained in:
jperkin 2017-06-27 15:51:39 +00:00
parent 5041d4ac4c
commit ec312e4b5e
2 changed files with 22 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.27 2017/06/19 20:46:31 wiz Exp $
$NetBSD: distinfo,v 1.28 2017/06/27 15:51:39 jperkin Exp $
SHA1 (alsa-lib-1.1.4.1.tar.bz2) = 628634afbdc19054fca26d714aa6c2f1e41e465d
RMD160 (alsa-lib-1.1.4.1.tar.bz2) = 703e99f22a6b399fe32419a2ccc95b9b6292db10
@ -21,3 +21,4 @@ SHA1 (patch-src_control_control__hw.c) = 07cfe3abe586b32f6b989403cd162599da07e86
SHA1 (patch-src_pcm_pcm__mmap.c) = 2d0f05aa53b30cef1ec083aa4f5d559d0a679058
SHA1 (patch-src_seq_seq__midi__event.c) = 2a5de492d6ca19a0f0c564e8f5a065e5fc57ea5c
SHA1 (patch-src_shmarea.c) = d6d0876ae7911ff16138bb82a3b1c79e795218cf
SHA1 (patch-src_ucm_parser.c) = 6682d702c5180ecddd1c6c8ecffe6064986ed8b1

View file

@ -0,0 +1,20 @@
$NetBSD: patch-src_ucm_parser.c,v 1.7 2017/06/27 15:51:39 jperkin Exp $
* SunOS has no dirent d_type
--- src/ucm/parser.c.orig 2017-06-01 06:27:36.000000000 +0000
+++ src/ucm/parser.c
@@ -1476,7 +1476,13 @@ static int filename_filter(const struct
{
if (dirent == NULL)
return 0;
+#ifdef __sun
+ struct stat s;
+ stat(dirent->d_name, &s);
+ if (s.st_mode & S_IFDIR) {
+#else
if (dirent->d_type == DT_DIR) {
+#endif
if (dirent->d_name[0] == '.') {
if (dirent->d_name[1] == '\0')
return 0;