summaryrefslogtreecommitdiff
path: root/gl/lib/pipe-safer.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-02-04 15:11:47 +0000
committerColin Watson <cjwatson@debian.org>2022-02-04 15:11:47 +0000
commit828b489c68a5a022c106656cfdff19bb9b584eec (patch)
tree7225919cd6e445d94080fa108a1a6b05fb890cf7 /gl/lib/pipe-safer.c
parenta2d4ffce13a855f29a63bac2099ebe0f5a4e50bd (diff)
parentbfe34108bc20e9d75e3f08bfc8305e4f4cd632a9 (diff)
Import man-db_2.10.0.orig.tar.xz
Diffstat (limited to 'gl/lib/pipe-safer.c')
-rw-r--r--gl/lib/pipe-safer.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gl/lib/pipe-safer.c b/gl/lib/pipe-safer.c
index 5a597c52..22f8695e 100644
--- a/gl/lib/pipe-safer.c
+++ b/gl/lib/pipe-safer.c
@@ -1,9 +1,9 @@
/* Invoke pipe, but avoid some glitches.
- Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -30,7 +30,6 @@
int
pipe_safer (int fd[2])
{
-#if HAVE_PIPE
if (pipe (fd) == 0)
{
int i;
@@ -39,18 +38,15 @@ pipe_safer (int fd[2])
fd[i] = fd_safer (fd[i]);
if (fd[i] < 0)
{
- int e = errno;
+ int saved_errno = errno;
close (fd[1 - i]);
- errno = e;
+ errno = saved_errno;
return -1;
}
}
return 0;
}
-#else
- errno = ENOSYS;
-#endif
return -1;
}