Skip to content

Commit

Permalink
call open_standard_streams() on startup to ensure stdin/stdout/stderr…
Browse files Browse the repository at this point in the history
… file descriptors exist
  • Loading branch information
ambrop7 committed Sep 4, 2011
1 parent 6f64bd5 commit 7c999b0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <misc/loglevel.h>
#include <misc/loggers_string.h>
#include <misc/string_begins_with.h>
#include <misc/open_standard_streams.h>
#include <structure/LinkedList2.h>
#include <base/DebugObject.h>
#include <base/BLog.h>
Expand Down Expand Up @@ -356,6 +357,9 @@ int main (int argc, char *argv[])
return 1;
}

// open standard streams
open_standard_streams();

// parse command-line arguments
if (!parse_arguments(argc, argv)) {
fprintf(stderr, "Failed to parse arguments\n");
Expand Down
4 changes: 4 additions & 0 deletions flooder/flooder.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <misc/nsskey.h>
#include <misc/byteorder.h>
#include <misc/loggers_string.h>
#include <misc/open_standard_streams.h>
#include <base/BLog.h>
#include <system/BReactor.h>
#include <system/BSignal.h>
Expand Down Expand Up @@ -155,6 +156,9 @@ int main (int argc, char *argv[])
return 1;
}

// open standard streams
open_standard_streams();

// parse command-line arguments
if (!parse_arguments(argc, argv)) {
fprintf(stderr, "Failed to parse arguments\n");
Expand Down
4 changes: 4 additions & 0 deletions ncd/ncd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <misc/concat_strings.h>
#include <misc/string_begins_with.h>
#include <misc/parse_number.h>
#include <misc/open_standard_streams.h>
#include <structure/LinkedList2.h>
#include <base/BLog.h>
#include <system/BReactor.h>
Expand Down Expand Up @@ -177,6 +178,9 @@ int main (int argc, char **argv)
return 1;
}

// open standard streams
open_standard_streams();

// parse command-line arguments
if (!parse_arguments(argc, argv)) {
fprintf(stderr, "Failed to parse arguments\n");
Expand Down
4 changes: 4 additions & 0 deletions server/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <misc/byteorder.h>
#include <misc/loglevel.h>
#include <misc/loggers_string.h>
#include <misc/open_standard_streams.h>
#include <predicate/BPredicate.h>
#include <base/DebugObject.h>
#include <base/BLog.h>
Expand Down Expand Up @@ -313,6 +314,9 @@ int main (int argc, char *argv[])
return 1;
}

// open standard streams
open_standard_streams();

// parse command-line arguments
if (!parse_arguments(argc, argv)) {
fprintf(stderr, "Failed to parse arguments\n");
Expand Down
4 changes: 4 additions & 0 deletions tun2socks/tun2socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <misc/udp_proto.h>
#include <misc/byteorder.h>
#include <misc/balloc.h>
#include <misc/open_standard_streams.h>
#include <structure/LinkedList2.h>
#include <base/BLog.h>
#include <system/BReactor.h>
Expand Down Expand Up @@ -208,6 +209,9 @@ int main (int argc, char **argv)
return 1;
}

// open standard streams
open_standard_streams();

// parse command-line arguments
if (!parse_arguments(argc, argv)) {
fprintf(stderr, "Failed to parse arguments\n");
Expand Down
4 changes: 4 additions & 0 deletions udpgw/udpgw.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <misc/offset.h>
#include <misc/byteorder.h>
#include <misc/bsize.h>
#include <misc/open_standard_streams.h>
#include <structure/LinkedList1.h>
#include <structure/BAVL.h>
#include <base/BLog.h>
Expand Down Expand Up @@ -173,6 +174,9 @@ int main (int argc, char **argv)
return 1;
}

// open standard streams
open_standard_streams();

// parse command-line arguments
if (!parse_arguments(argc, argv)) {
fprintf(stderr, "Failed to parse arguments\n");
Expand Down

0 comments on commit 7c999b0

Please sign in to comment.