chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: always explicitly close bus from main programs
[elogind.git]
/
src
/
journal-remote
/
journal-remote-write.c
diff --git
a/src/journal-remote/journal-remote-write.c
b/src/journal-remote/journal-remote-write.c
index cdd06f9effc25a9238eb289e1b9121010304fbb4..8ede950bea17b60003d6de6a5def1623bacf5628 100644
(file)
--- a/
src/journal-remote/journal-remote-write.c
+++ b/
src/journal-remote/journal-remote-write.c
@@
-20,7
+20,6
@@
***/
#include "journal-remote.h"
***/
#include "journal-remote.h"
-#include "journal-remote-write.h"
int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) {
if (!GREEDY_REALLOC(iovw->iovec, iovw->size_bytes, iovw->count + 1))
int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) {
if (!GREEDY_REALLOC(iovw->iovec, iovw->size_bytes, iovw->count + 1))
@@
-31,8
+30,6
@@
int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) {
}
void iovw_free_contents(struct iovec_wrapper *iovw) {
}
void iovw_free_contents(struct iovec_wrapper *iovw) {
- for (size_t j = 0; j < iovw->count; j++)
- free(iovw->iovec[j].iov_base);
free(iovw->iovec);
iovw->iovec = NULL;
iovw->size_bytes = iovw->count = 0;
free(iovw->iovec);
iovw->iovec = NULL;
iovw->size_bytes = iovw->count = 0;
@@
-41,12
+38,19
@@
void iovw_free_contents(struct iovec_wrapper *iovw) {
size_t iovw_size(struct iovec_wrapper *iovw) {
size_t n = 0, i;
size_t iovw_size(struct iovec_wrapper *iovw) {
size_t n = 0, i;
- for(i = 0; i < iovw->count; i++)
+ for
(i = 0; i < iovw->count; i++)
n += iovw->iovec[i].iov_len;
return n;
}
n += iovw->iovec[i].iov_len;
return n;
}
+void iovw_rebase(struct iovec_wrapper *iovw, char *old, char *new) {
+ size_t i;
+
+ for (i = 0; i < iovw->count; i++)
+ iovw->iovec[i].iov_base = (char*) iovw->iovec[i].iov_base - old + new;
+}
+
/**********************************************************************
**********************************************************************
**********************************************************************/
/**********************************************************************
**********************************************************************
**********************************************************************/