Module Name: src Committed By: bouyer Date: Sat Dec 14 19:31:17 UTC 2013
Modified Files: src/sys/compat/linux/common [netbsd-6]: linux_misc.c Log Message: Pull up following revision(s) (requested by hauke in ticket #993): sys/compat/linux/common/linux_misc.c: revision 1.227 On linux_sys_getdents, insert d_type at the end of each record. Fixes PR kern/47806. To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.219.8.1 src/sys/compat/linux/common/linux_misc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/linux/common/linux_misc.c diff -u src/sys/compat/linux/common/linux_misc.c:1.219 src/sys/compat/linux/common/linux_misc.c:1.219.8.1 --- src/sys/compat/linux/common/linux_misc.c:1.219 Fri Oct 14 09:23:28 2011 +++ src/sys/compat/linux/common/linux_misc.c Sat Dec 14 19:31:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp $ */ +/* $NetBSD: linux_misc.c,v 1.219.8.1 2013/12/14 19:31:17 bouyer Exp $ */ /*- * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.219.8.1 2013/12/14 19:31:17 bouyer Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -780,9 +780,10 @@ again: } idb.d_off = (linux_off_t)off; idb.d_reclen = (u_short)linux_reclen; + /* Linux puts d_type at the end of each record */ + *((char *)&idb + idb.d_reclen - 1) = bdp->d_type; } strcpy(idb.d_name, bdp->d_name); - idb.d_name[strlen(idb.d_name) + 1] = bdp->d_type; if ((error = copyout((void *)&idb, outp, linux_reclen))) goto out; /* advance past this real entry */