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

Commit 343ce615 authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

Merge "Fix a few clang-tidy issues and add NOLINT for others"

parents 0e04ce98 247ffbf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ class ScopedLogSeverity {
}  // namespace base
}  // namespace android

namespace std {
namespace std {  // NOLINT(cert-dcl58-cpp)

// Emit a warning of ostream<< with std::string*. The intention was most likely to print *string.
//
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
#define DM_VERSION2 (0)

#define DM_ALIGN_MASK (7)
#define DM_ALIGN(x) ((x + DM_ALIGN_MASK) & ~DM_ALIGN_MASK)
#define DM_ALIGN(x) (((x) + DM_ALIGN_MASK) & ~DM_ALIGN_MASK)

namespace android {
namespace dm {
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ void ActionManager::ExecuteOneCommand() {
        current_command_ = 0;
        if (action->oneshot()) {
            auto eraser = [&action](std::unique_ptr<Action>& a) { return a.get() == action; };
            actions_.erase(std::remove_if(actions_.begin(), actions_.end(), eraser));
            actions_.erase(std::remove_if(actions_.begin(), actions_.end(), eraser),
                           actions_.end());
        }
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ static Result<void> do_ifup(const BuiltinArguments& args) {

    strlcpy(ifr.ifr_name, args[1].c_str(), IFNAMSIZ);

    unique_fd s(TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_DGRAM, 0)));
    unique_fd s(TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0)));
    if (s < 0) return ErrnoError() << "opening socket failed";

    if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) {
@@ -784,7 +784,7 @@ static Result<void> do_write(const BuiltinArguments& args) {
}

static Result<void> readahead_file(const std::string& filename, bool fully) {
    android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(filename.c_str(), O_RDONLY)));
    android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(filename.c_str(), O_RDONLY | O_CLOEXEC)));
    if (fd == -1) {
        return ErrnoError() << "Error opening file";
    }
+2 −2
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ void FreeRamdisk(DIR* dir, dev_t dev) {

            if (S_ISDIR(info.st_mode)) {
                is_dir = true;
                auto fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY);
                auto fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
                if (fd >= 0) {
                    auto subdir =
                            std::unique_ptr<DIR, decltype(&closedir)>{fdopendir(fd), closedir};
@@ -152,7 +152,7 @@ int FirstStageMain(int argc, char** argv) {

    std::vector<std::pair<std::string, int>> errors;
#define CHECKCALL(x) \
    if (x != 0) errors.emplace_back(#x " failed", errno);
    if ((x) != 0) errors.emplace_back(#x " failed", errno);

    // Clear the umask.
    umask(0);
Loading