← Commit list

da996c5d2

Denys Vlasenko
Denys Vlasenko
2019-03-27
SUCCESS Duration: 148s

Subject

ntpd: do not create pid file if not backgrounded

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/ntpd.c+4 -2
@@ -2585,6 +2585,10 @@ static NOINLINE void ntp_init(char **argv)
/* -l but no peers: "stratum 1 server" mode */
G.stratum = 1;
}
+
+ if (!(opts & OPT_n)) /* only if backgrounded: */
+ write_pidfile_std_path_and_ext("ntpd");
+
/* If network is up, syncronization occurs in ~10 seconds.
* We give "ntpd -q" 10 seconds to get first reply,
* then another 50 seconds to finish syncing.
@@ -2641,8 +2645,6 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
*/
cnt = G.peer_cnt * (INITIAL_SAMPLES + 1);
- write_pidfile_std_path_and_ext("ntpd");
-
while (!bb_got_signal) {
llist_t *item;
unsigned i, j;