git: 15bd9fa3bea7 - main - procfs_doprocfile(): simplify
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 04 Nov 2021 04:14:20 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=15bd9fa3bea794054b4a5bd2f4bb71b0ba3aa3ba
commit 15bd9fa3bea794054b4a5bd2f4bb71b0ba3aa3ba
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-04 03:58:06 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-11-04 04:13:47 +0000
procfs_doprocfile(): simplify
Now that proc_get_binpath() does not return NULL in fullpath on success,
directly use sbuf_cat() over the value.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
---
sys/fs/procfs/procfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c
index 697bbfc9877a..38cfb4752279 100644
--- a/sys/fs/procfs/procfs.c
+++ b/sys/fs/procfs/procfs.c
@@ -77,7 +77,7 @@ procfs_doprocfile(PFS_FILL_ARGS)
PROC_LOCK(p);
error = proc_get_binpath(p, binpath, &fullpath, &freepath);
if (error == 0)
- sbuf_printf(sb, "%s", fullpath == NULL ? "" : fullpath);
+ sbuf_cat(sb, fullpath);
free(binpath, M_TEMP);
free(freepath, M_TEMP);
return (error);