751
|
1 |
--- gnomad2-2.9.0-orig/src/Makefile.am 2007-08-23 10:25:11.000000000 +0000
|
|
2 |
+++ gnomad2-2.9.0/src/Makefile.am 2007-12-30 10:59:06.085251005 +0000
|
|
3 |
@@ -33,7 +33,7 @@
|
|
4 |
data.c data.h player.c player.h common.h \
|
|
5 |
metadata.c metadata.h \
|
|
6 |
wmaread.c wmaread.h \
|
|
7 |
- wavfile.c wavfile.h
|
|
8 |
+ wavfile.c wavfile.h mkdtemp.c
|
|
9 |
|
|
10 |
if TAGLIB_COMPILE
|
|
11 |
gnomad2_SOURCES += tagfile.c tagfile.h
|
|
12 |
--- /dev/null 2007-12-30 11:06:24.000000000 +0000
|
|
13 |
+++ gnomad2-2.9.0/src/mkdtemp.c 2007-12-30 11:06:24.680745636 +0000
|
|
14 |
@@ -0,0 +1,67 @@
|
|
15 |
+/*
|
|
16 |
+ * CDDL HEADER START
|
|
17 |
+ *
|
|
18 |
+ * The contents of this file are subject to the terms of the
|
|
19 |
+ * Common Development and Distribution License (the "License").
|
|
20 |
+ * You may not use this file except in compliance with the License.
|
|
21 |
+ *
|
|
22 |
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
23 |
+ * or http://www.opensolaris.org/os/licensing.
|
|
24 |
+ * See the License for the specific language governing permissions
|
|
25 |
+ * and limitations under the License.
|
|
26 |
+ *
|
|
27 |
+ * When distributing Covered Code, include this CDDL HEADER in each
|
|
28 |
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
29 |
+ * If applicable, add the following below this CDDL HEADER, with the
|
|
30 |
+ * fields enclosed by brackets "[]" replaced with your own identifying
|
|
31 |
+ * information: Portions Copyright [yyyy] [name of copyright owner]
|
|
32 |
+ *
|
|
33 |
+ * CDDL HEADER END
|
|
34 |
+ */
|
|
35 |
+
|
|
36 |
+/*
|
|
37 |
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
|
38 |
+ * Use is subject to license terms.
|
|
39 |
+ */
|
|
40 |
+
|
|
41 |
+#pragma ident "%Z%%M% %I% %E% SMI"
|
|
42 |
+
|
|
43 |
+/*
|
|
44 |
+ * mkdtemp(3C) - create a directory with a unique name.
|
|
45 |
+ */
|
|
46 |
+
|
|
47 |
+/* #pragma weak mkdtemp = _mkdtemp */
|
|
48 |
+
|
|
49 |
+/* #include "synonyms.h" */
|
|
50 |
+
|
|
51 |
+#include <alloca.h>
|
|
52 |
+#include <errno.h>
|
|
53 |
+#include <stdlib.h>
|
|
54 |
+#include <string.h>
|
|
55 |
+#include <sys/stat.h>
|
|
56 |
+
|
|
57 |
+char *
|
|
58 |
+mkdtemp(char *template)
|
|
59 |
+{
|
|
60 |
+ char *t = alloca(strlen(template) + 1);
|
|
61 |
+ char *r;
|
|
62 |
+
|
|
63 |
+ /* Save template */
|
|
64 |
+ (void) strcpy(t, template);
|
|
65 |
+ for (; ; ) {
|
|
66 |
+ r = mktemp(template);
|
|
67 |
+
|
|
68 |
+ if (*r == '\0')
|
|
69 |
+ return (NULL);
|
|
70 |
+
|
|
71 |
+ if (mkdir(template, 0700) == 0)
|
|
72 |
+ return (r);
|
|
73 |
+
|
|
74 |
+ /* Other errors indicate persistent conditions. */
|
|
75 |
+ if (errno != EEXIST)
|
|
76 |
+ return (NULL);
|
|
77 |
+
|
|
78 |
+ /* Reset template */
|
|
79 |
+ (void) strcpy(template, t);
|
|
80 |
+ }
|
|
81 |
+}
|