projects
/
debian
/
amanda
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
upstream removed this so we don't need to
[debian/amanda]
/
xfer-src
/
xfer-test.c
diff --git
a/xfer-src/xfer-test.c
b/xfer-src/xfer-test.c
index 30e69700e8afa30ce0e100f8c87ecc87eee34504..f71894066c743a4ad607e3fb9510bfaf465c1169 100644
(file)
--- a/
xfer-src/xfer-test.c
+++ b/
xfer-src/xfer-test.c
@@
-20,10
+20,10
@@
* Author: Dustin J. Mitchell <dustin@zmanda.com>
*/
* Author: Dustin J. Mitchell <dustin@zmanda.com>
*/
+#include "amanda.h"
#include "amxfer.h"
#include "glib-util.h"
#include "testutils.h"
#include "amxfer.h"
#include "glib-util.h"
#include "testutils.h"
-#include "amanda.h"
#include "event.h"
#include "simpleprng.h"
#include "sockaddr-util.h"
#include "event.h"
#include "simpleprng.h"
#include "sockaddr-util.h"
@@
-103,7
+103,7
@@
source_readfd_setup_impl(
g_critical("Error from pipe(): %s", strerror(errno));
self->write_fd = p[1];
g_critical("Error from pipe(): %s", strerror(errno));
self->write_fd = p[1];
-
XFER_ELEMENT(self)->output_fd = p[0]
;
+
g_assert(xfer_element_swap_output_fd(elt, p[0]) == -1)
;
return TRUE;
}
return TRUE;
}
@@
-184,8
+184,12
@@
source_writefd_thread(
gpointer data)
{
XferSourceWritefd *self = XFER_SOURCE_WRITEFD(data);
gpointer data)
{
XferSourceWritefd *self = XFER_SOURCE_WRITEFD(data);
+ XferElement *elt = XFER_ELEMENT(data);
char buf[TEST_XFER_SIZE];
char buf[TEST_XFER_SIZE];
- int fd = XFER_ELEMENT(self)->downstream->input_fd;
+ int fd = xfer_element_swap_input_fd(elt->downstream, -1);
+
+ /* this shouldn't happen, although non-test elements handle it gracefully */
+ g_assert(fd != -1);
simpleprng_fill_buffer(&self->prng, buf, sizeof(buf));
simpleprng_fill_buffer(&self->prng, buf, sizeof(buf));
@@
-194,7
+198,6
@@
source_writefd_thread(
}
close(fd);
}
close(fd);
- XFER_ELEMENT(self)->downstream->input_fd = -1;
xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
@@
-757,9
+760,13
@@
dest_readfd_thread(
gpointer data)
{
XferDestReadfd *self = XFER_DEST_READFD(data);
gpointer data)
{
XferDestReadfd *self = XFER_DEST_READFD(data);
+ XferElement *elt = XFER_ELEMENT(data);
char buf[TEST_XFER_SIZE];
size_t remaining;
char buf[TEST_XFER_SIZE];
size_t remaining;
- int fd = XFER_ELEMENT(self)->upstream->output_fd;
+ int fd = xfer_element_swap_output_fd(elt->upstream, -1);
+
+ /* this shouldn't happen, although non-test elements handle it gracefully */
+ g_assert(fd != -1);
remaining = sizeof(buf);
while (remaining) {
remaining = sizeof(buf);
while (remaining) {
@@
-778,7
+785,6
@@
dest_readfd_thread(
g_critical("data entering XferDestReadfd does not match");
close(fd);
g_critical("data entering XferDestReadfd does not match");
close(fd);
- XFER_ELEMENT(self)->upstream->output_fd = -1;
xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
@@
-885,7
+891,6
@@
dest_writefd_thread(
g_critical("data entering XferDestWritefd does not match");
close(fd);
g_critical("data entering XferDestWritefd does not match");
close(fd);
- XFER_ELEMENT(self)->upstream->output_fd = -1;
xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
@@
-905,7
+910,7
@@
dest_writefd_setup_impl(
g_critical("Error from pipe(): %s", strerror(errno));
self->read_fd = p[0];
g_critical("Error from pipe(): %s", strerror(errno));
self->read_fd = p[0];
-
XFER_ELEMENT(self)->input_fd = p[1]
;
+
g_assert(xfer_element_swap_input_fd(elt, p[1]) == -1)
;
return TRUE;
}
return TRUE;
}