Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d305a18 authored by Felipe Leme's avatar Felipe Leme
Browse files

Discard empty tombstones on zipped bugreport.

Change-Id: I0717e21c4a0ad66c78690e3620cfdcf2b1bbcd59
Fixes: 27146385
parent 6b58591e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -104,8 +104,8 @@ static bool is_user_build() {
    return 0 == strncmp(build_type, "user", PROPERTY_VALUE_MAX - 1);
}

/* gets the tombstone data, according to the bugreport type: if zipped gets all tombstones,
 * otherwise gets just those modified in the last half an hour. */
/* gets the tombstone data, according to the bugreport type: if zipped, gets all tombstones;
 * otherwise, gets just those modified in the last half an hour. */
static void get_tombstone_fds(tombstone_data_t data[NUM_TOMBSTONES]) {
    time_t thirty_minutes_ago = now - 60*30;
    for (size_t i = 0; i < NUM_TOMBSTONES; i++) {
@@ -113,7 +113,7 @@ static void get_tombstone_fds(tombstone_data_t data[NUM_TOMBSTONES]) {
        int fd = TEMP_FAILURE_RETRY(open(data[i].name,
                                         O_RDONLY | O_CLOEXEC | O_NOFOLLOW | O_NONBLOCK));
        struct stat st;
        if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode) &&
        if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode) && st.st_size > 0 &&
            (zip_writer || (time_t) st.st_mtime >= thirty_minutes_ago)) {
            data[i].fd = fd;
        } else {