summaryrefslogtreecommitdiffstats
path: root/sbin/shutdown/shutdown.c
Commit message (Collapse)AuthorAgeFilesLines
* Restore a piece of BSD history.des2012-08-011-3/+3
| | | | | | PR: 169127 Submitted by: Ruben de Groot <ruben@hacktor.com> MFC after: 1 week
* shutdown: Remove unnecessary 2-second delay.jilles2012-05-231-1/+0
|
* Replace index() and rindex() calls with strchr() and strrchr().ed2012-01-031-1/+1
| | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls.
* Add missing static keywords for global variables to tools in sbin/.ed2011-11-041-1/+1
| | | | | | These tools declare global variables without using the static keyword, even though their use is limited to a single C-file, or without placing an extern declaration of them in the proper header file.
* For compatibility with Linux and Solaris add poweroff(8).pjd2010-12-301-2/+26
| | | | | | | | | | | It is implemented as a hard link to shutdown(8) and it is equivalent of: # shutdown -p now While I'm here put one line of usage into one line of C code so it is easier to grep(1) and separate unrelated code with empty line. MFC after: 2 weeks
* Add missing `void' for functions without arguments.ed2009-12-291-4/+4
| | | | | While there, rename die_you_gravy_sucking_pig_dog() to something that's less moronic.
* Static'ify internal methods and use prototype.delphij2009-09-281-20/+20
|
* Use new style declarations instead of K&R ones.delphij2005-01-251-10/+5
|
* Use modern style defination for main() and move a externdelphij2005-01-251-4/+3
| | | | | | declaration to global section. Bump WARNS?= to 6
* Remove advertising clause from University of California Regent's license,markm2004-04-091-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core, imp
* Centralize _PATH_* definitions.obrien2003-05-051-2/+1
| | | | Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me)
* Use __FBSDID() to quiet GCC 3.3 warnings.obrien2003-05-031-4/+4
|
* o remove __Pimp2002-03-211-9/+9
| | | | o remove main prototype
* Constify, de-register-ify, __unused-ify, and set WARNS=2.dd2001-07-151-10/+11
| | | | Submitted by: Mike Barcroft <mike@q9media.com>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Avoid ambigious if/elsebillf1999-07-211-2/+3
|
* Signal init(8) instead of executing halt(8) or reboot(8)ru1999-06-211-34/+52
| | | | | | | | | | when halting or rebooting the system. It benefits from running /etc/rc.shutdown by init(8). ``-o'' flag is provided for backward compatibility. PR: 5451 Discussed with: des
* Minor cleanups to shutdown(8):jkoshy1999-06-211-4/+10
| | | | | | | | | - Make the -k "don't actually halt" flag incompatible with the halt/reboot options -h, -p, and -r. - The -n "don't sync" option is ignored if -k is specified. Issue a warning message. - Compute the actual shutdown time written to /var/run/nologin correctly in the case of "now" being specified.
* Fix a coredump with negative (due to overflow) offset values.ru1999-06-181-3/+4
|
* Merged from Lite2 (one bcopy -> memmove, one significant change:bde1998-12-111-4/+5
| | | | | don't unlink _PATH_NOLOGIN for the -k case even if shutdown terminates abnormally. NetBSD already has this change).
* Fixed missing 'p' and `-' flags and other defects in the usage message.bde1998-12-111-4/+5
| | | | Fixed some style bugs.
* Add a '-p' flag to shutdown which corresponds to the '-p' flag to halt,msmith1998-12-101-6/+18
| | | | requesting a system power-off after shutdown.
* Correct use of .Nm. Add rcsid. Do not dot terminate err(3) strings. Spelling.charnier1998-08-031-9/+10
|
* Pass an actual empty environment to execle() as per POSIX rather thanalex1998-01-101-10/+28
| | | | | | | | | | | rely on undocumented behavior. The following fixes were obtained from OpenBSD: o -Wall fixes to tlist array initialization and assignment used as truth value. o Use a restricted environment. o Improved error message when shutdown fails to exec reboot or halt.
* Added environment parameter to execle calls.alex1998-01-081-3/+3
| | | | Obtained from: NetBSD PR2737 (augustss@cs.chalmers.se) via OpenBSD
* Correct a comment from my last commit.alex1998-01-081-2/+2
|
* Allow 'shutdown datespec' to work into the next century. Handle datesalex1998-01-081-1/+12
| | | | | in the 22nd century and beyond even though it's irrelevant with a 32-bit time_t which expires in the year 2038.
* Make the daemon process a true daemon by calling setsid().joerg1997-08-231-1/+2
| | | | | PR: bin/3202 Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
* Use err(3).charnier1997-06-191-21/+13
|
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* -n was brokenadam1997-01-211-5/+0
| | | | 2.2 candidate (probably)
* Delete bogus referneces to timezone code internal header file `tzfile.h',wollman1995-08-071-1/+0
| | | | which is no longer bogusly installed in /usr/include.
* Yanked out (now obsolete) support for 'fastboot'.dg1995-02-151-27/+4
|
* Submitted by: M.C. Wongats1994-11-271-1/+1
| | | | | Obtained from: Don't throw away the /etc/nologin file in the -k case.
* BSD 4.4 Lite sbin Sourcesrgrimes1994-05-261-0/+492
Note: XNSrouted and routed NOT imported here, they shall be imported with usr.sbin.
OpenPOWER on IntegriCloud