diff --git a/src/logger.h b/src/logger.h index 5ca34b75a..938153309 100644 --- a/src/logger.h +++ b/src/logger.h @@ -41,7 +41,7 @@ class Logger : public SingletonLogger { unsigned int whiteList{0}; public: - enum Policy : unsigned int { + enum Policy : unsigned char { #define GEN_ENUM(E) E, EACH_LOGGING_POLICY(GEN_ENUM) #undef GEN_ENUM diff --git a/src/object.cpp b/src/object.cpp index c80651cf9..14f788f58 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -115,7 +115,7 @@ uint32_t Value::getMetaData() const { union { // NOLINT char i8[4]; uint32_t u32; - } conv; + } conv = {}; memcpy(conv.i8, this->str.value + 11, 4); return conv.u32; } diff --git a/tools/process/process.cpp b/tools/process/process.cpp index e1a79b752..fcc335ca1 100644 --- a/tools/process/process.cpp +++ b/tools/process/process.cpp @@ -292,8 +292,6 @@ static void openPTY(const IOConfig &config, int &masterFD, int &slaveFD) { } } -static void setCLOEXEC(int fd) { fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); } - class StreamBuilder { private: const IOConfig config; @@ -335,9 +333,9 @@ class StreamBuilder { close(this->masterFD); } - setCLOEXEC(this->inputWriter()); - setCLOEXEC(this->outputReader()); - setCLOEXEC(this->errorReader()); + arsh::setCloseOnExec(this->inputWriter(), true); + arsh::setCloseOnExec(this->outputReader(), true); + arsh::setCloseOnExec(this->errorReader(), true); } int findPTY() const {