git.samba.org
/
tridge
/
junkcode.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
show all threads
[tridge/junkcode.git]
/
foo5.c
1
2
int sys_open(const char *fname, int opts)
3
{
4
int ret;
5
6
do {
7
ret = open(fname, opts);
8
} while (ret == -1 && errno == EINTR);
9
return ret;
10
}
11
12
main()
13
{
14
char *fname = "foo.txt";
15
int fd;
16
17
again:
18
fd = sys_open(fname, O_RDONLY);
19
if (fd == -1) {
20
if (errno == EINTR) goto again;
21
perror(fname);
22
exit(1);
23
}
24
25
26
}