all: check stdout and stderr status at exit
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>
This commit is contained in:
2
tload.c
2
tload.c
@ -27,6 +27,7 @@
|
||||
#include "proc/version.h"
|
||||
#include "proc/sysinfo.h"
|
||||
#include "c.h"
|
||||
#include "fileutils.h"
|
||||
#include "nls.h"
|
||||
#include "strutils.h"
|
||||
#include "xalloc.h"
|
||||
@ -117,6 +118,7 @@ int main(int argc, char **argv)
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||
textdomain(PACKAGE);
|
||||
atexit(close_stdout);
|
||||
|
||||
while ((opt =
|
||||
getopt_long(argc, argv, "s:d:Vh", longopts, NULL)) != -1)
|
||||
|
Reference in New Issue
Block a user