X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-netflow.c;h=b85c663e4d0d798256446d02d591cb99236d95bb;hb=634408e0c5e9d99b55c40ab4df608f822ef923a7;hp=5a88ada3cde0f6fe031b19da253575723c6b11df;hpb=17f7f7e02cfd44dc7755fbebcfb942c07f937858;p=openvswitch diff --git a/tests/test-netflow.c b/tests/test-netflow.c index 5a88ada3..b85c663e 100644 --- a/tests/test-netflow.c +++ b/tests/test-netflow.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Nicira Networks. + * Copyright (c) 2011, 2012 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -190,7 +190,6 @@ main(int argc, char *argv[]) bool exiting = false; int error; int sock; - int fd; int n; proctitle_init(argc, argv); @@ -208,10 +207,7 @@ main(int argc, char *argv[]) ovs_fatal(0, "%s: failed to open (%s)", argv[1], strerror(-sock)); } - /* Daemonization will close stdout but we really want to keep it, so make a - * copy. */ - fd = dup(STDOUT_FILENO); - + daemon_save_fd(STDOUT_FILENO); daemonize_start(); error = unixctl_server_create(NULL, &server); @@ -222,9 +218,6 @@ main(int argc, char *argv[]) daemonize_complete(); - /* Now get stdout back. */ - dup2(fd, STDOUT_FILENO); - ofpbuf_init(&buf, MAX_RECV); n = 0; for (;;) {