]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_rgw_admin: musl libc defines stdout as read-only. Use freopen for output redirec... 6303/head
authorJohn Coyle <dx9err@gmail.com>
Mon, 19 Oct 2015 02:39:48 +0000 (22:39 -0400)
committerJohn Coyle <dx9err@gmail.com>
Mon, 19 Oct 2015 02:42:53 +0000 (22:42 -0400)
Signed-off-by: John Coyle <dx9err@gmail.com>
src/test/test_rgw_admin_log.cc
src/test/test_rgw_admin_meta.cc
src/test/test_rgw_admin_opstate.cc

index 46b69eb6f2d6ac89f116696acd536e37845c03ed..f460251f20a4307eda6bcd3da34bdf1766022078 100644 (file)
@@ -327,9 +327,7 @@ int run_rgw_admin(string& cmd, string& resp) {
       argv[loop++] = (char *)(*it).c_str();
     }
     argv[loop] = NULL;
-    close(1);
-    stdout = fopen(RGW_ADMIN_RESP_PATH, "w+");
-    if (!stdout) {
+    if (!freopen(RGW_ADMIN_RESP_PATH, "w+", stdout)) {
       cout << "Unable to open stdout file" << std::endl;
     }
     execv((g_test->get_rgw_admin_path()).c_str(), argv); 
index 5b0d6a66bdfb82fce7fa9099c95f423f219ad4b9..063b9ea88fc2531f33770703707fcd4402194f3f 100644 (file)
@@ -321,9 +321,7 @@ int run_rgw_admin(string& cmd, string& resp) {
       argv[loop++] = (char *)(*it).c_str();
     }
     argv[loop] = NULL;
-    close(1);
-    stdout = fopen(RGW_ADMIN_RESP_PATH, "w+");
-    if (!stdout) {
+    if (!freopen(RGW_ADMIN_RESP_PATH, "w+", stdout)) {
       cout << "Unable to open stdout file" << std::endl;
     }
     execv((g_test->get_rgw_admin_path()).c_str(), argv); 
index a9a65f51b07ff2f4f6ba4f167e4a0db6ac373358..26568578c98aa4bf573e5a32d7dd4c66466f1a33 100644 (file)
@@ -325,9 +325,7 @@ int run_rgw_admin(string& cmd, string& resp) {
       argv[loop++] = (char *)(*it).c_str();
     }
     argv[loop] = NULL;
-    close(1);
-    stdout = fopen(RGW_ADMIN_RESP_PATH, "w+");
-    if (!stdout) {
+    if (!freopen(RGW_ADMIN_RESP_PATH, "w+", stdout)) {
       cout << "Unable to open stdout file" << std::endl;
     }
     execv((g_test->get_rgw_admin_path()).c_str(), argv);