diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-03-25 21:45:42 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-03-25 21:46:44 -0500 |
commit | 3cb887f0bd51a18011dc31957ddf9e4a4ae28790 (patch) | |
tree | afb67ce3a83dd708603f2d5af7872f29f5ed5ce3 | |
parent | 74420ea7f95ef10e9a91022d6815deacc1dcdedd (diff) | |
download | horizon-3cb887f0bd51a18011dc31957ddf9e4a4ae28790.tar.gz horizon-3cb887f0bd51a18011dc31957ddf9e4a4ae28790.tar.bz2 horizon-3cb887f0bd51a18011dc31957ddf9e4a4ae28790.tar.xz horizon-3cb887f0bd51a18011dc31957ddf9e4a4ae28790.zip |
meta: Tidy code
* Use <cassert> instead of <assert.h>.
* Include <cstring> for ::strerror in install env.
* Consistently use ::strerror.
* Remove superfluous duplicate semicolon.
Fixes: #334
-rw-r--r-- | hscript/meta.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc index e3d05f2..af72eaf 100644 --- a/hscript/meta.cc +++ b/hscript/meta.cc @@ -10,12 +10,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -#include <assert.h> +#include <cassert> #include <fstream> #include <regex> #include <set> #include <sstream> #ifdef HAS_INSTALL_ENV +# include <cstring> # include <sys/mount.h> # include "util/filesystem.hh" #endif /* HAS_INSTALL_ENV */ @@ -625,7 +626,7 @@ Key *SvcEnable::parseFromData(const std::string &data, const ScriptLocation &pos, int *errors, int *, const Script *script) { const static std::string valid_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890.-_"; - std::string::size_type space = data.find_first_of(' ');; + std::string::size_type space = data.find_first_of(' '); std::string svc, runlevel{"default"}; if(space != std::string::npos) { @@ -849,7 +850,7 @@ bool Bootloader::execute() const { if(mount("efivarfs", efipath.c_str(), "efivarfs", MS_NOEXEC | MS_NODEV | MS_NOSUID | MS_RELATIME, nullptr) != 0) { output_error(pos, "bootloader: failed to mount writable efivarfs", - strerror(errno)); + ::strerror(errno)); return false; } |