summaryrefslogtreecommitdiff
path: root/uptime.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'refs/merge-requests/2' of git://gitorious.org/procps/procps ↵Craig Small2013-09-111-3/+8
|\ | | | | | | | | | | | | into merge-requests/2 Conflicts: uptime.c
| * Add -p|--pretty option to uptime(1) for pretty output.David Cantrell2012-02-221-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the -p option to the uptime(1) command, which changes the uptime displayed from something like: 10:35:52 up 2:33, 1 user, load average: 1.69, 1.65, 1.63 to: up 2 hours, 33 minutes I originally implemented this as the up(1) program about 14 years ago. In 2008 or 2009, I created a patch for procps to add this functionality to uptime and submitted it to the project. Never heard from the project and no new releases of procps had been made. Then I found out about this project and decided to port my patch to it. So here it is. This is really just for fun. There is no real technical reason to have this functionality. But even now, 14 years later, I still get emails asking where the source code for up is. So I thought it would be nice for the uptime command on Linux to sport the up functionality by default.
* | configure: check for program_invocation_nameRainer Müller2013-03-201-0/+2
| | | | | | | | | | | | | | | | | | | | For portabiliy, check for program_invocation_name during configure and define HAVE_PROGRAM_INVOCATION_NAME accordingly. Use of this symbol is now enclosed with the appropriate #ifdef block. The symbol program_invocation_name is only used for error message handling using error(), so it's safe to omit this if it is not available.
* | uptime: add since optionFrank Fesevur2012-12-261-1/+31
| | | | | | | | | | | | | | | | The --since or -s option will show the time since the host was online. Reference(s): http://www.freelists.org/post/procps/Patch-Added-since-option-to-uptime Signed-off-by: Craig Small <csmall@enc.com.au>
* | all: check stdout and stderr status at exitSami Kerola2012-03-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If stream status is not checked at the end of execution below problem would not report error, or non-zero exit code. The uptime is just an example same was true with all commands of the project. $ uptime >&- ; echo $? uptime: write error: Bad file descriptor 1 $ uptime >/dev/full ; echo $? uptime: write error: No space left on device 1 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | docs: clarification to license headers in filesSami Kerola2012-03-031-0/+19
|/ | | | | | | | | | | | | | | Add license header to all files. The summary of licensing is below, taken from Craig Small's email which is referred in commit message tail. sysctl and pgrep are GPL 2+ The rest is LGPL 2.1+ Reference: http://www.freelists.org/post/procps/Incorrect-FSF-address-in-the-license-files,8 Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=797962 CC: Craig Small <csmall@enc.com.au> CC: Jaromir Capik <jcapik@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Changed the err and warns to macrosCraig Small2012-01-031-0/+1
| | | | | | | | | | | | err and warn are BSD format but they are not recommended by library developers. However their consiseness is useful! The solution is to use some macros that create xerr etc which then just map to the error() function. The next problem is error() uses program_invocation_name so we set this to program_invovation_short_name This is a global set but seems to be the convention (or at least errors are on the short name only) used everywhere else.
* nls: add functions which take translations to be usedSami Kerola2011-12-201-0/+4
| | | | | | | | | | | | Add the following three functions to most of the commands. setlocale (LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); Reference: http://www.freelists.org/post/procps/backporting,1 Reported-by: Jim Warner <james.warner@comcast.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* uptime: add gettext supportSami Kerola2011-12-201-10/+11
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* uptime: new usage & fix coding styleSami Kerola2011-12-201-12/+40
| | | | | | Coding style fixed and more readable help output. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* uptime -V #122521albert2002-10-081-1/+1
|
* Put most of the Debian patches incsmall2002-02-011-3/+11
| | | | added a lot of cvsignore files
* procps 010114csmall2002-02-011-0/+9