Browse Source

move __progname initialization to before first use

Thanks to pbhenson for noticing this.
OPENBSD_5_8
Brent Cook 9 years ago
parent
commit
ed06bf2eb2
4 changed files with 16 additions and 9 deletions
  1. +12
    -5
      patches/0009-initialize-setproctitle-where-needed.patch
  2. +1
    -1
      patches/0010-document-SIGUSR1-fallback-if-SIGINFO-is-not-implemen.patch
  3. +1
    -1
      patches/0011-Notify-the-user-when-constraint-support-is-disabled.patch
  4. +2
    -2
      patches/0012-add-a-method-for-updating-the-realtime-clock-on-sync.patch

+ 12
- 5
patches/0009-initialize-setproctitle-where-needed.patch View File

@ -1,4 +1,4 @@
From 4a432aeecaeab8e3504cfad7c9cbab65cfbb07c5 Mon Sep 17 00:00:00 2001
From fd8a742d7e3f2ff92e812cdccfb3477b948340fc Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 12 Jan 2015 06:18:31 -0600
Subject: [PATCH 09/12] initialize setproctitle where needed
@ -10,7 +10,7 @@ clobbering them.
1 file changed, 20 insertions(+)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index c7935bf..44caa80 100644
index c7935bf..310e808 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -112,6 +112,13 @@ usage(void)
@ -27,12 +27,19 @@ index c7935bf..44caa80 100644
int
main(int argc, char *argv[])
{
@@ -135,6 +142,19 @@ main(int argc, char *argv[])
log_init(1); /* log to stderr until daemonized */
@@ -124,6 +131,8 @@ main(int argc, char *argv[])
struct passwd *pw;
extern char *__progname;
+ __progname = get_progname(argv[0]);
+
if (strcmp(__progname, "ntpctl") == 0) {
ctl_main(argc, argv);
/* NOTREACHED */
@@ -135,6 +144,17 @@ main(int argc, char *argv[])
log_init(1); /* log to stderr until daemonized */
+#ifndef HAVE_SETPROCTITLE
+ int i;
+ /* Prepare for later setproctitle emulation */


+ 1
- 1
patches/0010-document-SIGUSR1-fallback-if-SIGINFO-is-not-implemen.patch View File

@ -1,4 +1,4 @@
From f706e8544dd183e8d32979f0029e408bc6b64468 Mon Sep 17 00:00:00 2001
From 60c072f759cadd167a929e035b33877b1f08103a Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 12 Jan 2015 21:17:35 -0600
Subject: [PATCH 10/12] document SIGUSR1 fallback if SIGINFO is not


+ 1
- 1
patches/0011-Notify-the-user-when-constraint-support-is-disabled.patch View File

@ -1,4 +1,4 @@
From 73702698d7f337b008d58a8db6d93e8a7556a425 Mon Sep 17 00:00:00 2001
From 12e4fcd674dd852fe8838c60fee6168344df8b5f Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Fri, 27 Mar 2015 23:14:15 -0500
Subject: [PATCH 11/12] Notify the user when constraint support is disabled.


+ 2
- 2
patches/0012-add-a-method-for-updating-the-realtime-clock-on-sync.patch View File

@ -1,4 +1,4 @@
From af468fcc4de3c1bfa280c1ec90a89d27d9ce9cda Mon Sep 17 00:00:00 2001
From 0ae8358adca5935a76b908938104ef9cb1ee60c1 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 4 May 2015 04:27:29 -0500
Subject: [PATCH 12/12] add a method for updating the realtime clock on sync
@ -9,7 +9,7 @@ from Christian Weisgerber
1 file changed, 2 insertions(+)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index 44caa80..fb9a8df 100644
index 310e808..2f89aed 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -53,6 +53,7 @@ const char *ctl_lookup_option(char *, const char **);


Loading…
Cancel
Save