Page MenuHomeFreeBSD

D56533.id175920.diff
No OneTemporary

D56533.id175920.diff

diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc
--- a/usr.sbin/ctld/ctld.cc
+++ b/usr.sbin/ctld/ctld.cc
@@ -1962,22 +1962,14 @@
log_init(conf_debug);
}
- /*
- * Rename the pidfile if the pathname changes. On startup,
- * oldconf created via conf_new_from_kernel will not contain a
- * valid pidfile_path.
- */
- if (!oldconf->conf_pidfile_path.empty()) {
- if (oldconf->conf_pidfile_path != conf_pidfile_path) {
- /* pidfile has changed. rename it */
- log_debugx("moving pidfile to %s",
+ /* Rename the pidfile if the pathname changes. */
+ if (oldconf->conf_pidfile_path != conf_pidfile_path) {
+ log_debugx("moving pidfile to %s", conf_pidfile_path.c_str());
+ if (rename(oldconf->conf_pidfile_path.c_str(),
+ conf_pidfile_path.c_str()) != 0) {
+ log_err(1, "renaming pidfile %s -> %s",
+ oldconf->conf_pidfile_path.c_str(),
conf_pidfile_path.c_str());
- if (rename(oldconf->conf_pidfile_path.c_str(),
- conf_pidfile_path.c_str()) != 0) {
- log_err(1, "renaming pidfile %s -> %s",
- oldconf->conf_pidfile_path.c_str(),
- conf_pidfile_path.c_str());
- }
}
}
@@ -2753,6 +2745,9 @@
newconf->set_debug(debug);
}
+ /* Reuse the pidfile path from the configuration file. */
+ oldconf->set_pidfile_path(newconf->pidfile_path());
+
if (!newconf->add_pports(kports))
log_errx(1, "Error associating physical ports; exiting");

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 2, 4:05 PM (16 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40089201
Default Alt Text
D56533.id175920.diff (1 KB)

Event Timeline