Date: Wed, 24 Jul 2013 22:43:40 +0000 (UTC) From: Jim Harris <jimharris@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253628 - stable/9/sbin/nvmecontrol Message-ID: <201307242243.r6OMheBd037294@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jimharris Date: Wed Jul 24 22:43:40 2013 New Revision: 253628 URL: http://svnweb.freebsd.org/changeset/base/253628 Log: MFC r253459: Use _PATH_DEV (from paths.h) for the "/dev/" string, rather than hard-coding it. Approved by: re (kib) Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/devlist.c stable/9/sbin/nvmecontrol/nvmecontrol.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/devlist.c ============================================================================== --- stable/9/sbin/nvmecontrol/devlist.c Wed Jul 24 22:42:00 2013 (r253627) +++ stable/9/sbin/nvmecontrol/devlist.c Wed Jul 24 22:43:40 2013 (r253628) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include <err.h> #include <errno.h> #include <fcntl.h> +#include <paths.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> @@ -82,7 +83,7 @@ devlist(int argc, char *argv[]) if (ret != 0) { if (ret == EACCES) { - warnx("could not open /dev/%s\n", name); + warnx("could not open "_PATH_DEV"%s\n", name); continue; } else break; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 24 22:42:00 2013 (r253627) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 24 22:43:40 2013 (r253628) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include <err.h> #include <errno.h> #include <fcntl.h> +#include <paths.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> @@ -175,7 +176,7 @@ open_dev(const char *str, int *fd, int s return (EINVAL); } - snprintf(full_path, sizeof(full_path), "/dev/%s", str); + snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); *fd = open(full_path, O_RDWR); if (*fd < 0) { if (show_error)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307242243.r6OMheBd037294>