Date: Wed, 3 Feb 2016 15:16:20 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295211 - stable/10/sys/dev/pty Message-ID: <201602031516.u13FGKr2086349@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Feb 3 15:16:20 2016 New Revision: 295211 URL: https://svnweb.freebsd.org/changeset/base/295211 Log: MFC r293825: Switch legacy pty clone handler to use make_dev_s(9). MFC r294594: Remove printf only useful for debugging. Approved by: re (marius) Modified: stable/10/sys/dev/pty/pty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pty/pty.c ============================================================================== --- stable/10/sys/dev/pty/pty.c Wed Feb 3 14:34:25 2016 (r295210) +++ stable/10/sys/dev/pty/pty.c Wed Feb 3 15:16:20 2016 (r295211) @@ -97,6 +97,8 @@ static void pty_clone(void *arg, struct ucred *cr, char *name, int namelen, struct cdev **dev) { + struct make_dev_args mda; + int error; /* Cloning is already satisfied. */ if (*dev != NULL) @@ -117,8 +119,15 @@ pty_clone(void *arg, struct ucred *cr, c return; /* Create the controller device node. */ - *dev = make_dev_credf(MAKEDEV_REF, &ptydev_cdevsw, 0, - NULL, UID_ROOT, GID_WHEEL, 0666, "%s", name); + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_REF; + mda.mda_devsw = &ptydev_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0666; + error = make_dev_s(&mda, dev, "%s", name); + if (error != 0) + *dev = NULL; } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602031516.u13FGKr2086349>