Mercurial > gnulib
annotate lib/unlockpt.c @ 40231:9b3c79fdfe0b
strtod: fix clash with strtold
Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817).
* lib/strtod.c (compute_minus_zero, minus_zero):
Simplify by remving the macro / external variable,
and having just a function. User changed. This avoids
the need for an external variable that might clash.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 11 Mar 2019 16:40:29 -0700 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
13030 | 1 /* Unlock the slave side of a pseudo-terminal from its master side. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 1998, 2010-2019 Free Software Foundation, Inc. |
13030 | 3 Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998. |
4 | |
5 This program is free software: you can redistribute it and/or modify | |
6 it under the terms of the GNU General Public License as published by | |
7 the Free Software Foundation; either version 3 of the License, or | |
8 (at your option) any later version. | |
9 | |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
19190 | 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
13030 | 17 |
18 #include <config.h> | |
19 | |
20 #include <stdlib.h> | |
21 | |
15979
69cc1dcd696b
unlockpt: Detect invalid argument.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
22 #include <fcntl.h> |
13030 | 23 #include <unistd.h> |
24 | |
25 int | |
26 unlockpt (int fd) | |
27 { | |
28 /* Platforms which have the TIOCSPTLCK ioctl (Linux) already have the | |
29 unlockpt function. */ | |
30 #if HAVE_REVOKE | |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
31 /* Mac OS X 10.3, OpenBSD 3.8 do not have the unlockpt function, but they |
13030 | 32 have revoke(). */ |
33 char *name = ptsname (fd); | |
34 if (name == NULL) | |
35 return -1; | |
36 return revoke (name); | |
37 #else | |
38 /* Assume that the slave side of a pseudo-terminal is already unlocked | |
39 by default. */ | |
15979
69cc1dcd696b
unlockpt: Detect invalid argument.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
40 if (fcntl (fd, F_GETFD) < 0) |
69cc1dcd696b
unlockpt: Detect invalid argument.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
41 return -1; |
13030 | 42 return 0; |
43 #endif | |
44 } |