]> git.saurik.com Git - apple/libc.git/blob - compat-43/FreeBSD/creat.c.patch
Libc-763.11.tar.gz
[apple/libc.git] / compat-43 / FreeBSD / creat.c.patch
1 --- creat.c.orig 2009-11-06 10:36:38.000000000 -0800
2 +++ creat.c 2009-11-06 10:39:44.000000000 -0800
3 @@ -33,14 +33,26 @@ static char sccsid[] = "@(#)creat.c 8.1
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/compat-43/creat.c,v 1.8 2007/01/09 00:27:49 imp Exp $");
6
7 +
8 #include "namespace.h"
9 #include <fcntl.h>
10 #include "un-namespace.h"
11
12 +#ifdef VARIANT_CANCELABLE
13 +int __open(const char *path, int flags, mode_t mode);
14 +#else /* !VARIANT_CANCELABLE */
15 +int __open_nocancel(const char *path, int flags, mode_t mode);
16 +#endif /* VARIANT_CANCELABLE */
17 +
18 +
19 int
20 __creat(const char *path, mode_t mode)
21 {
22 - return(_open(path, O_WRONLY|O_CREAT|O_TRUNC, mode));
23 +#ifdef VARIANT_CANCELABLE
24 + return(__open(path, O_WRONLY|O_CREAT|O_TRUNC, mode));
25 +#else /* !VARIANT_CANCELABLE */
26 + return(__open_nocancel(path, O_WRONLY|O_CREAT|O_TRUNC, mode));
27 +#endif /* VARIANT_CANCELABLE */
28 }
29 __weak_reference(__creat, creat);
30 __weak_reference(__creat, _creat);