From 45660f6ee670a808cc4541d3ee3b8a2989f29a85 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sat, 25 Jan 2014 21:50:09 +0000 Subject: [PATCH] Rename internal functions warn() and shutdown() in the shutdown binary to avoid surprising dynamic library name resolution conflict with NSS modules. Patch from Richard Tollerton. --- doc/Changelog | 3 +++ src/shutdown.c | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index af970ba..bf3bc99 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -53,6 +53,9 @@ sysvinit (2.89dsf) UNRELEASED; urgency=low kernel 3.0 and above * Improve message printed when signaling processes to stop. Patch from Matias A. Fonzo at the dragora project. + * Rename internal functions warn() and shutdown() in the shutdown + binary to avoid surprising dynamic library name resolution + conflict with NSS modules. Patch from Richard Tollerton. -- Petter Reinholdtsen Sun Apr 11 11:28:55 CEST 2010 diff --git a/src/shutdown.c b/src/shutdown.c index dc3eab0..6318f58 100644 --- a/src/shutdown.c +++ b/src/shutdown.c @@ -213,7 +213,7 @@ int init_setenv(char *name, char *value) /* * Tell everyone the system is going down in 'mins' minutes. */ -void warn(int mins) +void issue_warn(int mins) { char buf[MESSAGELEN + sizeof(newstate)]; int len; @@ -400,14 +400,14 @@ void fastdown() /* * Go to runlevel 0, 1 or 6. */ -void shutdown(char *halttype) +void issue_shutdown(char *halttype) { char *args[8]; int argp = 0; int do_halt = (down_level[0] == '0'); /* Warn for the last time */ - warn(0); + issue_warn(0); if (dontshut) { hardsleep(1); stopit(0); @@ -749,20 +749,20 @@ int main(int argc, char **argv) if (wt < 0) wt += 1440; } /* Shutdown NOW if time == 0 */ - if (wt == 0) shutdown(halttype); + if (wt == 0) issue_shutdown(halttype); /* Give warnings on regular intervals and finally shutdown. */ - if (wt < 15 && !needwarning(wt)) warn(wt); + if (wt < 15 && !needwarning(wt)) issue_warn(wt); while(wt) { if (wt <= 5 && !didnolog) { donologin(wt); didnolog++; } - if (needwarning(wt)) warn(wt); + if (needwarning(wt)) issue_warn(wt); hardsleep(60); wt--; } - shutdown(halttype); + issue_shutdown(halttype); return 0; /* Never happens */ }