author | X gate hg captive account <xhg@xserver.us.oracle.com> |
Wed, 19 Aug 2015 13:48:41 -0700 | |
changeset 1484 | bc8922b8e1d2 |
parent 1233 | 1134c9fd2fe6 |
permissions | -rw-r--r-- |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
1 |
/* |
1233
1134c9fd2fe6
7125797 Fix crufty code complaints uncovered by xorg-macros new tougher defaults
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
2 |
* Copyright (c) 1990, 2011, Oracle and/or its affiliates. All rights reserved. |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
3 |
* |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
5 |
* copy of this software and associated documentation files (the "Software"), |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
6 |
* to deal in the Software without restriction, including without limitation |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
8 |
* and/or sell copies of the Software, and to permit persons to whom the |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
9 |
* Software is furnished to do so, subject to the following conditions: |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
10 |
* |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
11 |
* The above copyright notice and this permission notice (including the next |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
12 |
* paragraph) shall be included in all copies or substantial portions of the |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
13 |
* Software. |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
14 |
* |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
15 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
16 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
17 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
18 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
19 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
20 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
21 |
* DEALINGS IN THE SOFTWARE. |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
22 |
* |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
23 |
*/ |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
24 |
|
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
25 |
#include <sys/fcntl.h> |
1233
1134c9fd2fe6
7125797 Fix crufty code complaints uncovered by xorg-macros new tougher defaults
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
26 |
#include <unistd.h> |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
27 |
#include <X11/Xlib.h> |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
28 |
#include "cmc.h" |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
29 |
#include "cmcutil.h" |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
30 |
|
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
31 |
|
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
32 |
/* |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
33 |
** Removes the file containing the shared workspace colors, |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
34 |
** if it exists. |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
35 |
*/ |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
36 |
|
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
37 |
void |
1233
1134c9fd2fe6
7125797 Fix crufty code complaints uncovered by xorg-macros new tougher defaults
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
38 |
cmc_discard (void) |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
39 |
|
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
40 |
{ |
1233
1134c9fd2fe6
7125797 Fix crufty code complaints uncovered by xorg-macros new tougher defaults
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
41 |
const char *filename = comp_colors_filename(basename_arg); |
550
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
42 |
|
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
43 |
if (unlink(filename) < 0) |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
44 |
fatal_error("cannot remove file '%s'", filename); |
3b62053c3b77
6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff
changeset
|
45 |
} |