]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/serial.c
Tweak mutex order for SD
[bacula/bacula] / bacula / src / lib / serial.c
index 93855b6de753d01177bc95ca6b51c7b185a25ff9..6b803f16dba88da9ddfdb8547823aec0ed55cc58 100644 (file)
@@ -7,19 +7,32 @@
      Version $Id$
 */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   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 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   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 two of the GNU General Public
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
+
+   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 should have received a copy of the GNU 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.
+
+   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.
+*/
 
 
 #include "bacula.h"
@@ -79,7 +92,7 @@ void serial_uint32(uint8_t * * const ptr, const uint32_t v)
 
 void serial_int64(uint8_t * * const ptr, const int64_t v)
 {
-    if (htonl(1) == 1L) {
+    if (bigendian()) {
         memcpy(*ptr, &v, sizeof(int64_t));
     } else {
         int i;
@@ -99,7 +112,7 @@ void serial_int64(uint8_t * * const ptr, const int64_t v)
 
 void serial_uint64(uint8_t * * const ptr, const uint64_t v)
 {
-    if (htonl(1) == 1L) {
+    if (bigendian()) {
         memcpy(*ptr, &v, sizeof(uint64_t));
     } else {
         int i;
@@ -119,7 +132,7 @@ void serial_uint64(uint8_t * * const ptr, const uint64_t v)
 
 void serial_btime(uint8_t * * const ptr, const btime_t v)
 {
-    if (htonl(1) == 1L) {
+    if (bigendian()) {
         memcpy(*ptr, &v, sizeof(btime_t));
     } else {
         int i;
@@ -145,7 +158,7 @@ void serial_btime(uint8_t * * const ptr, const btime_t v)
 
 void serial_float64(uint8_t * * const ptr, const float64_t v)
 {
-    if (htonl(1) == 1L) {
+    if (bigendian()) {
         memcpy(*ptr, &v, sizeof(float64_t));
     } else {
         int i;
@@ -219,7 +232,7 @@ uint64_t unserial_uint64(uint8_t * * const ptr)
 {
     uint64_t v;
 
-    if (htonl(1) == 1L) {
+    if (bigendian()) {
         memcpy(&v, *ptr, sizeof(uint64_t));
     } else {
         int i;
@@ -242,7 +255,7 @@ btime_t unserial_btime(uint8_t * * const ptr)
 {
     btime_t v;
 
-    if (htonl(1) == 1L) {
+    if (bigendian()) {
         memcpy(&v, *ptr, sizeof(btime_t));
     } else {
         int i;
@@ -272,7 +285,7 @@ float64_t unserial_float64(uint8_t * * const ptr)
 {
     float64_t v;
 
-    if (htonl(1) == 1L) {
+    if (bigendian()) {
         memcpy(&v, *ptr, sizeof(float64_t));
     } else {
         int i;