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

Commit 35183814 authored by Felipe Leme's avatar Felipe Leme
Browse files

Resolve merge conflicts of 6108f5d4 to nyc-mr1-dev

BUG: 28867848
Change-Id: I99392f1706af5fb9268ad1b32aa7f4b10e397d84
parents 730cd512 6108f5d4
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -61,11 +61,7 @@ static time_t now;
static std::unique_ptr<ZipWriter> zip_writer;
static std::set<std::string> mount_points;
void add_mountinfo();
static bool add_zip_entry(const std::string& entry_name, const std::string& entry_path);
static bool add_zip_entry_from_fd(const std::string& entry_name, int fd);
static int control_socket_fd;
/* full path of the directory where the bugreport files will be written */
static std::string bugreport_dir;
/* suffix of the bugreport files - it's typically the date (when invoked with -d),
 * although it could be changed by the user using a system property */
static std::string suffix;
@@ -89,8 +85,8 @@ typedef struct {

static tombstone_data_t tombstone_data[NUM_TOMBSTONES];

// Root dir for all files copied as-is into the bugreport
const std::string& ZIP_ROOT_DIR = "FS";
const std::string ZIP_ROOT_DIR = "FS";
std::string bugreport_dir;

/*
 * List of supported zip format versions.
@@ -559,8 +555,7 @@ static void print_header(std::string version) {
    printf("\n");
}

/* adds a new entry to the existing zip file. */
static bool add_zip_entry_from_fd(const std::string& entry_name, int fd) {
bool add_zip_entry_from_fd(const std::string& entry_name, int fd) {
    if (!zip_writer) {
        MYLOGD("Not adding zip entry %s from fd because zip_writer is not set\n",
                entry_name.c_str());
@@ -601,8 +596,7 @@ static bool add_zip_entry_from_fd(const std::string& entry_name, int fd) {
    return true;
}

/* adds a new entry to the existing zip file. */
static bool add_zip_entry(const std::string& entry_name, const std::string& entry_path) {
bool add_zip_entry(const std::string& entry_name, const std::string& entry_path) {
    ScopedFd fd(TEMP_FAILURE_RETRY(open(entry_path.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC)));
    if (fd.get() == -1) {
        MYLOGE("open(%s): %s\n", entry_path.c_str(), strerror(errno));
+12 −0
Original line number Diff line number Diff line
@@ -81,6 +81,18 @@ static const int WEIGHT_FILE = 5;
 * idioms (like using std::string instead of char*, removing varargs, etc...) */
extern int do_update_progress, progress, weight_total;

/* full path of the directory where the bugreport files will be written */
extern std::string bugreport_dir;

/* root dir for all files copied as-is into the bugreport. */
extern const std::string ZIP_ROOT_DIR;

/* adds a new entry to the existing zip file. */
bool add_zip_entry(const std::string& entry_name, const std::string& entry_path);

/* adds a new entry to the existing zip file. */
bool add_zip_entry_from_fd(const std::string& entry_name, int fd);

/* prints the contents of a file */
int dump_file(const char *title, const char *path);