chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cat: fix priority type
[elogind.git]
/
src
/
journal
/
journal-file.c
diff --git
a/src/journal/journal-file.c
b/src/journal/journal-file.c
index 6460d70c4aef18c28223070150056bdbb0c45295..c7ebcdb25cbe57315c4e1ada08a651760c61452b 100644
(file)
--- a/
src/journal/journal-file.c
+++ b/
src/journal/journal-file.c
@@
-40,7
+40,7
@@
#define COMPRESSION_SIZE_THRESHOLD (512ULL)
/* This is the minimum journal file size */
#define COMPRESSION_SIZE_THRESHOLD (512ULL)
/* This is the minimum journal file size */
-#define JOURNAL_FILE_SIZE_MIN (64ULL*1024ULL)
+#define JOURNAL_FILE_SIZE_MIN (64ULL*1024ULL)
/* 64 KiB */
/* These are the lower and upper bounds if we deduce the max_use value
* from the file system size */
/* These are the lower and upper bounds if we deduce the max_use value
* from the file system size */
@@
-793,8
+793,8
@@
static uint64_t journal_file_entry_array_n_items(Object *o) {
}
static int link_entry_into_array(JournalFile *f,
}
static int link_entry_into_array(JournalFile *f,
-
uint
64_t *first,
-
uint
64_t *idx,
+
le
64_t *first,
+
le
64_t *idx,
uint64_t p) {
int r;
uint64_t n = 0, ap = 0, q, i, a, hidx;
uint64_t p) {
int r;
uint64_t n = 0, ap = 0, q, i, a, hidx;
@@
-857,9
+857,9
@@
static int link_entry_into_array(JournalFile *f,
}
static int link_entry_into_array_plus_one(JournalFile *f,
}
static int link_entry_into_array_plus_one(JournalFile *f,
-
uint
64_t *extra,
-
uint
64_t *first,
-
uint
64_t *idx,
+
le
64_t *extra,
+
le
64_t *first,
+
le
64_t *idx,
uint64_t p) {
int r;
uint64_t p) {
int r;
@@
-873,7
+873,7
@@
static int link_entry_into_array_plus_one(JournalFile *f,
if (*idx == 0)
*extra = htole64(p);
else {
if (*idx == 0)
*extra = htole64(p);
else {
-
uint
64_t i;
+
le
64_t i;
i = htole64(le64toh(*idx) - 1);
r = link_entry_into_array(f, first, &i, p);
i = htole64(le64toh(*idx) - 1);
r = link_entry_into_array(f, first, &i, p);
@@
-1887,7
+1887,10
@@
int journal_file_open_reliably(
char *p;
r = journal_file_open(fname, flags, mode, template, ret);
char *p;
r = journal_file_open(fname, flags, mode, template, ret);
- if (r != -EBADMSG)
+ if (r != -EBADMSG && /* corrupted */
+ r != -ENODATA && /* truncated */
+ r != -EHOSTDOWN && /* other machine */
+ r != -EPROTONOSUPPORT) /* incompatible feature */
return r;
if ((flags & O_ACCMODE) == O_RDONLY)
return r;
if ((flags & O_ACCMODE) == O_RDONLY)
@@
-2141,7
+2144,8
@@
int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
items = alloca(sizeof(EntryItem) * n);
for (i = 0; i < n; i++) {
items = alloca(sizeof(EntryItem) * n);
for (i = 0; i < n; i++) {
- uint64_t le_hash, l, h;
+ uint64_t l, h;
+ le64_t le_hash;
size_t t;
void *data;
Object *u;
size_t t;
void *data;
Object *u;