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

Commit 972f1ba1 authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

Merge changes Ib0f33d2f,Ife6c09dd,I55ed5656

* changes:
  logd: enable -Wextra
  logd: don't check of the timestamp of audit messages is monotonic
  Remove the monotonic option for logging
parents 1af4a81f 053dacab
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -60,8 +60,6 @@ Public Functions and Macros
    LOG_EVENT_INT(tag, value)
    LOG_EVENT_LONG(tag, value)

    clockid_t android_log_clockid()

    log_id_t android_logger_get_id(struct logger *logger)
    int android_logger_clear(struct logger *logger)
    int android_logger_get_log_size(struct logger *logger)
+0 −6
Original line number Diff line number Diff line
@@ -133,12 +133,6 @@ typedef enum {
  (void)__android_log_bswrite(_tag, _value);
#endif

#ifdef __linux__

clockid_t android_log_clockid(void);

#endif /* __linux__ */

/* --------------------------------------------------------------------- */

/*
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ static int write_to_log(log_id_t log_id, struct iovec* vec, size_t nr) {
    return -EINVAL;
  }

  clock_gettime(android_log_clockid(), &ts);
  clock_gettime(CLOCK_REALTIME, &ts);

  if (log_id == LOG_ID_SECURITY) {
    if (vec[0].iov_len < 4) {
+4 −11
Original line number Diff line number Diff line
@@ -216,11 +216,7 @@ AndroidLogFormat* android_log_format_new() {
  p_ret->year_output = false;
  p_ret->zone_output = false;
  p_ret->epoch_output = false;
#ifdef __ANDROID__
  p_ret->monotonic_output = android_log_clockid() == CLOCK_MONOTONIC;
#else
  p_ret->monotonic_output = false;
#endif
  p_ret->uid_output = false;
  p_ret->descriptive_output = false;
  descriptive_output = false;
@@ -1465,14 +1461,11 @@ char* android_log_formatLogLine(AndroidLogFormat* p_format, char* defaultBuffer,
  nsec = entry->tv_nsec;
#if __ANDROID__
  if (p_format->monotonic_output) {
    /* prevent convertMonotonic from being called if logd is monotonic */
    if (android_log_clockid() != CLOCK_MONOTONIC) {
    struct timespec time;
    convertMonotonic(&time, entry);
    now = time.tv_sec;
    nsec = time.tv_nsec;
  }
  }
#endif
  if (now < 0) {
    nsec = NS_PER_SEC - nsec;
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ ssize_t __android_log_pmsg_file_write(log_id_t logId, char prio, const char* fil
    return -EINVAL;
  }

  clock_gettime(android_log_clockid(), &ts);
  clock_gettime(CLOCK_REALTIME, &ts);

  cp = strdup(filename);
  if (!cp) {
Loading