lintian doesn't like orphan packages with uploaders...
[debian/amanda] / xfer-src / dest-directtcp-connect.c
index 131b6f726f7a0315da1690746cd447cb9cc58e51..37a8e4aa3c9aa182f58e5b70d859d6a285e37f10 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008-2012 Zmanda, Inc.  All Rights Reserved.
  *
- * 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 published
- * by the Free Software Foundation.
+ * 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 2
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -19,8 +20,8 @@
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
-#include "amxfer.h"
 #include "amanda.h"
+#include "amxfer.h"
 #include "sockaddr-util.h"
 
 /*
@@ -69,7 +70,7 @@ setup_impl(
 {
     XferDestDirectTCPConnect *self = (XferDestDirectTCPConnect *)elt;
 
-    g_assert(self->addrs && self->addrs->ipv4);
+    g_assert(self->addrs && SU_GET_FAMILY(self->addrs) != 0);
     elt->input_listen_addrs = self->addrs;
 
     return TRUE;
@@ -96,8 +97,8 @@ class_init(
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     GObjectClass *goc = G_OBJECT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, 0, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->setup = setup_impl;
@@ -146,7 +147,7 @@ xfer_dest_directtcp_connect(
 
     g_assert(addrs != NULL);
 
-    for (i = 0; addrs[i].port; i++) ;
+    for (i = 0; SU_GET_FAMILY(&addrs[i]) != 0; i++);
     self->addrs = g_memdup(addrs, (i+1) * sizeof(*addrs));
 
     return elt;