]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gnulib/import/getcwd-lgpl.c
Update gnulib
[thirdparty/binutils-gdb.git] / gnulib / import / getcwd-lgpl.c
index e8c9e08cb33e309ed87c9f19571b267369153aa0..f449ac85cdb1ed221a133a5c30db3a299fe8dc70 100644 (file)
@@ -1,17 +1,17 @@
-/* Copyright (C) 2011-2021 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2022 Free Software Foundation, Inc.
    This file is part of gnulib.
 
-   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
-   (at your option) any later version.
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   This file is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GNU Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
@@ -69,11 +69,7 @@ rpl_getcwd (char *buf, size_t size)
         }
       result = getcwd (buf, size);
       if (!result)
-        {
-          int saved_errno = errno;
-          free (buf);
-          errno = saved_errno;
-        }
+        free (buf);
       return result;
     }
 
@@ -112,11 +108,7 @@ rpl_getcwd (char *buf, size_t size)
   while (!result && errno == ERANGE);
 
   if (!result)
-    {
-      int saved_errno = errno;
-      free (buf);
-      errno = saved_errno;
-    }
+    free (buf);
   else
     {
       /* Here result == buf.  */