svn commit: r196017 - projects/libprocstat/usr.bin/fstat

Stanislav Sedov stas at FreeBSD.org
Sat Aug 1 14:06:57 UTC 2009


Author: stas
Date: Sat Aug  1 14:06:56 2009
New Revision: 196017
URL: http://svn.freebsd.org/changeset/base/196017

Log:
  - Do not try to pass NULL pointer as the error buf.

Modified:
  projects/libprocstat/usr.bin/fstat/fstat.c
  projects/libprocstat/usr.bin/fstat/fuser.c

Modified: projects/libprocstat/usr.bin/fstat/fstat.c
==============================================================================
--- projects/libprocstat/usr.bin/fstat/fstat.c	Sat Aug  1 13:58:46 2009	(r196016)
+++ projects/libprocstat/usr.bin/fstat/fstat.c	Sat Aug  1 14:06:56 2009	(r196017)
@@ -229,13 +229,14 @@ print_file_info(struct procstat *procsta
 	DEVS *d;
 	const char *filename;
 	int error, fsmatch = 0;
+	char errbuf[_POSIX2_LINE_MAX];
 
 	filename = NULL;
 	if (checkfile != 0) {
 		if (fst->fs_type != PS_FST_TYPE_VNODE &&
 		    fst->fs_type != PS_FST_TYPE_FIFO)
 			return;
-		error = procstat_get_vnode_info(procstat, fst, &vn, NULL);
+		error = procstat_get_vnode_info(procstat, fst, &vn, errbuf);
 		if (error != 0)
 			return;
 

Modified: projects/libprocstat/usr.bin/fstat/fuser.c
==============================================================================
--- projects/libprocstat/usr.bin/fstat/fuser.c	Sat Aug  1 13:58:46 2009	(r196016)
+++ projects/libprocstat/usr.bin/fstat/fuser.c	Sat Aug  1 14:06:56 2009	(r196017)
@@ -288,6 +288,7 @@ dofiles(struct procstat *procstat, struc
 	struct filestat_list *head;
 	int error, match;
 	unsigned int i;
+	char errbuf[_POSIX2_LINE_MAX];
 	
 	head = procstat_getfiles(procstat, kp, flags & MFLAG);
 	if (head == NULL)
@@ -295,7 +296,7 @@ dofiles(struct procstat *procstat, struc
 	STAILQ_FOREACH(fst, head, next) {
 		if (fst->fs_type != PS_FST_TYPE_VNODE)
 			continue;
-		error = procstat_get_vnode_info(procstat, fst, &vn, NULL);
+		error = procstat_get_vnode_info(procstat, fst, &vn, errbuf);
 		if (error != 0)
 			continue;
 		for (i = 0; i < nfiles; i++) {


More information about the svn-src-projects mailing list