Skip to content

Commit 6304e9c

Browse files
committed
Inline strings
1 parent e244345 commit 6304e9c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/unistd/test_unistd_write_broken_link.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,22 @@
66

77

88
int main() {
9-
char* p1 = "link_source";
10-
char* p2 = "link_target";
11-
12-
int res = symlink(p2, p1);
9+
int res = symlink("link_target", "link_source");
1310
printf("link result: %d\n", res);
14-
int src_fd = open(p1, O_CREAT | O_WRONLY, 0777);
11+
int src_fd = open("link_source", O_CREAT | O_WRONLY, 0777);
1512
printf("source_fd: %d, errno: %d %s\n", src_fd, errno, strerror(errno));
1613
write(src_fd, "abc", 3);
1714
close(src_fd);
1815
{
19-
int target_fd = open(p2, O_RDONLY);
16+
int target_fd = open("link_target", O_RDONLY);
2017
printf("target_fd: %d, errno: %d %s\n", target_fd, errno, strerror(errno));
2118
char buf[10];
2219
read(target_fd, buf, 10);
2320
printf("buf: '%s'\n", buf);
2421
close(target_fd);
2522
}
2623
{
27-
int target_fd = open(p1, O_RDONLY);
24+
int target_fd = open("link_source", O_RDONLY);
2825
printf("target_fd: %d, errno: %d %s\n", target_fd, errno, strerror(errno));
2926
char buf[10];
3027
read(target_fd, buf, 10);

0 commit comments

Comments
 (0)