]>
Commit | Line | Data |
---|---|---|
fdeea3f4 ZJS |
1 | @@ |
2 | expression f, path, options; | |
3 | @@ | |
4 | - f = fopen(path, options); | |
5 | - if (!f) | |
6 | - return -errno; | |
7 | - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); | |
8 | + r = fopen_unlocked(path, options, &f); | |
9 | + if (r < 0) | |
10 | + return r; | |
11 | @@ | |
12 | expression f, path, options; | |
13 | @@ | |
14 | - f = fopen(path, options); | |
15 | - if (!f) { | |
16 | - if (errno == ENOENT) | |
17 | - return -ESRCH; | |
18 | - return -errno; | |
19 | - } | |
20 | - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); | |
21 | + r = fopen_unlocked(path, options, &f); | |
22 | + if (r == -ENOENT) | |
23 | + return -ESRCH; | |
24 | + if (r < 0) | |
25 | + return r; | |
26 | @@ | |
27 | expression f, path, options; | |
28 | @@ | |
29 | - f = fopen(path, options); | |
30 | - if (!f) | |
31 | - return errno == ENOENT ? -ESRCH : -errno; | |
32 | - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); | |
33 | + r = fopen_unlocked(path, options, &f); | |
34 | + if (r == -ENOENT) | |
35 | + return -ESRCH; | |
36 | + if (r < 0) | |
37 | + return r; | |
41f6e627 ZJS |
38 | @@ |
39 | expression f, path, p; | |
40 | @@ | |
41 | r = fopen_temporary(path, &f, &p); | |
42 | if (r < 0) | |
43 | return ...; | |
44 | - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); | |
45 | @@ | |
46 | expression f, g, path, p; | |
47 | @@ | |
48 | r = fopen_temporary_label(path, g, &f, &p); | |
49 | if (r < 0) | |
50 | return ...; | |
51 | - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); | |
02e23d1a ZJS |
52 | @@ |
53 | expression f, fd, options; | |
54 | @@ | |
55 | - f = fdopen(fd, options); | |
56 | + r = fdopen_unlocked(fd, options, &f); | |
57 | + if (r < 0) { | |
58 | - if (!f) { | |
59 | ... | |
60 | - return -errno; | |
61 | + return r; | |
62 | } | |
63 | - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); | |
2fe21124 ZJS |
64 | @@ |
65 | expression f, buf, sz; | |
66 | @@ | |
67 | - f = open_memstream(&buf, &sz); | |
68 | + f = open_memstream_unlocked(&buf, &sz); | |
69 | if (!f) | |
70 | return ...; | |
71 | - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); |