]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/berrno.c
Change copyright as per agreement with FSFE
[bacula/bacula] / bacula / src / lib / berrno.c
index 13ffb03125555cc21d1353f6e7b962d03c1d110f..747337db2c4298b2aff4cd9d7289730b1c27e9af 100644 (file)
@@ -1,29 +1,20 @@
 /*
-   Bacula® - The Network Backup Solution
+   Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2004-2011 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2016 Kern Sibbald
 
-   The main author of Bacula is Kern Sibbald, with contributions from
-   many others, a complete list can be found in the file AUTHORS.
-   This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version three of the GNU Affero General Public
-   License as published by the Free Software Foundation and included
-   in the file LICENSE.
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
 
-   This program 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.
+   You may use this file and others of this release according to the
+   license defined in the LICENSE file, which includes the Affero General
+   Public License, v3.0 ("AGPLv3") and some additional permissions and
+   terms pursuant to its AGPLv3 Section 7.
 
-   You should have received a copy of the GNU Affero General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
 
-   Bacula® is a registered trademark of Kern Sibbald.
-   The licensor of Bacula is the Free Software Foundation Europe
-   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
-   Switzerland, email:ftf@fsfeurope.org.
+   Bacula(R) is a registered trademark of Kern Sibbald.
 */
 /*
  *  Bacula errno handler
@@ -50,7 +41,7 @@ const char *berrno::bstrerror()
 {
    *m_buf = 0;
 #ifdef HAVE_WIN32
-   if (m_berrno & b_errno_win32) {
+   if (m_berrno & (b_errno_win32 | b_errno_WSA)) {
       format_win32_message();
       return (const char *)m_buf;
    }
@@ -83,7 +74,7 @@ const char *berrno::bstrerror()
    }
 #endif
    /* Normal errno */
-   if (b_strerror(m_berrno, m_buf, 1024) < 0) {
+   if (b_strerror(m_berrno, m_buf, sizeof_pool_memory(m_buf)) < 0) {
       return _("Invalid errno. No error message possible.");
    }
    return m_buf;
@@ -96,7 +87,7 @@ void berrno::format_win32_message()
    FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
        FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
        NULL,
-       GetLastError(),
+       m_berrno & b_errno_WSA ? WSAGetLastError() : GetLastError(),
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
        (LPTSTR)&msg,
        0,