From cee146c035c1f9b95acc1e31a061aae7e80b7986 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 25 Jan 2014 17:24:45 +0000 Subject: [PATCH] Add compat_10, open NULL == open "." --- sys/kern/vfs_syscalls.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 6e68be3cddde..c5887fdf6f23 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.474 2014/01/25 02:28:31 christos Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.475 2014/01/25 17:24:45 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.474 2014/01/25 02:28:31 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.475 2014/01/25 17:24:45 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_fileassoc.h" @@ -1623,9 +1623,16 @@ do_sys_openat(lwp_t *l, int fdat, const char *path, int flags, struct pathbuf *pb; int error; - error = pathbuf_copyin(path, &pb); - if (error) - return error; +#ifdef COMPAT_10 /* XXX: and perhaps later */ + if (path == NULL) + pb = pathbuf_create("."); + else +#endif + { + error = pathbuf_copyin(path, &pb); + if (error) + return error; + } if (fdat != AT_FDCWD) { /* fd_getvnode() will use the descriptor for us */