提交 39588e2e 编写于 作者: J jwx1265790

Fix testcase failed

Issue: https://gitee.com/openharmony/third_party_musl/issues/I7TP1Y

test: libc-test
Signed-off-by: Njwx1265790 <2510840462@qq.com>
上级 b8c0b494
...@@ -40,12 +40,13 @@ void forkpty_0100(void) ...@@ -40,12 +40,13 @@ void forkpty_0100(void)
fp = fopen("test1.txt", "w+"); fp = fopen("test1.txt", "w+");
fwrite(sign_r, sizeof(char), strlen(sign_r), fp); fwrite(sign_r, sizeof(char), strlen(sign_r), fp);
fclose(fp); fclose(fp);
exit(EXIT_SUCCESS);
} else { } else {
wait(NULL);
fp = fopen("test2.txt", "w+"); fp = fopen("test2.txt", "w+");
fwrite(sign_r, sizeof(char), strlen(sign_r), fp); fwrite(sign_r, sizeof(char), strlen(sign_r), fp);
fclose(fp); fclose(fp);
}
sleep(1);
FILE *fp1 = fopen("test1.txt", "r"); FILE *fp1 = fopen("test1.txt", "r");
FILE *fp2 = fopen("test2.txt", "r"); FILE *fp2 = fopen("test2.txt", "r");
fread(list1, sizeof(list1), 1, fp1); fread(list1, sizeof(list1), 1, fp1);
...@@ -56,6 +57,7 @@ void forkpty_0100(void) ...@@ -56,6 +57,7 @@ void forkpty_0100(void)
fclose(fp2); fclose(fp2);
remove("test1.txt"); remove("test1.txt");
remove("test2.txt"); remove("test2.txt");
}
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册