git: 7982c36da11c - stable/14 - kyua: Don't pass NULL to unique_ptr constructors
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Jan 2026 15:39:51 UTC
The branch stable/14 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=7982c36da11c94ac8ece46b23fadcf607d0e8396
commit 7982c36da11c94ac8ece46b23fadcf607d0e8396
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-05-03 15:58:47 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-01-29 15:17:28 +0000
kyua: Don't pass NULL to unique_ptr constructors
This is ambiguous when NULL is defined to an integral constant.
Instead, use the more iodiomatic pattern of {} to construct a default
pointer.
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D50090
(cherry picked from commit 26d4ac7a2725c0ab2d536c402fc0185fe7afed85)
---
contrib/kyua/utils/process/child.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/kyua/utils/process/child.cpp b/contrib/kyua/utils/process/child.cpp
index bfde8159d5c8..d554f1fd9fb5 100644
--- a/contrib/kyua/utils/process/child.cpp
+++ b/contrib/kyua/utils/process/child.cpp
@@ -223,7 +223,7 @@ process::child::fork_capture_aux(void)
std::cerr << F("Failed to set up subprocess: %s\n") % e.what();
std::abort();
}
- return std::unique_ptr< process::child >(NULL);
+ return {};
} else {
::close(fds[1]);
LD(F("Spawned process %s: stdout and stderr inherited") % pid);
@@ -284,7 +284,7 @@ process::child::fork_files_aux(const fs::path& stdout_file,
std::cerr << F("Failed to set up subprocess: %s\n") % e.what();
std::abort();
}
- return std::unique_ptr< process::child >(NULL);
+ return {};
} else {
LD(F("Spawned process %s: stdout=%s, stderr=%s") % pid % stdout_file %
stderr_file);