mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-14 03:39:53 +03:00
79 lines
2.4 KiB
Diff
79 lines
2.4 KiB
Diff
From: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
|
|
Subject: [PATCH] Fix getopts and fs::flag to match latest Hare changes
|
|
Date: Fri, 15 Sep 2023 15:36:19 -0300
|
|
MIME-Version: 1.0
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
---
|
|
It would be nice if you could release a new version containing
|
|
these fixes, so I could package downstream.
|
|
|
|
main.ha | 10 +++++-----
|
|
sysfs.ha | 2 +-
|
|
2 files changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/main.ha b/main.ha
|
|
index 9e80e9a..0a59752 100644
|
|
--- a/main.ha
|
|
+++ b/main.ha
|
|
@@ -44,7 +44,7 @@ export fn main() void = {
|
|
|
|
if (op == operation::QUERY) {
|
|
if (len(cmd.args) != 0) {
|
|
- getopt::printhelp(os::stderr, "powerctl", help...);
|
|
+ getopt::printhelp(os::stderr, "powerctl", help...)!;
|
|
os::exit(1);
|
|
};
|
|
|
|
@@ -64,7 +64,7 @@ export fn main() void = {
|
|
};
|
|
|
|
if (len(cmd.args) != 1) {
|
|
- getopt::printhelp(os::stderr, "powerctl", help...);
|
|
+ getopt::printhelp(os::stderr, "powerctl", help...)!;
|
|
os::exit(1);
|
|
};
|
|
|
|
@@ -76,7 +76,7 @@ export fn main() void = {
|
|
case let state: disk_state =>
|
|
yield state;
|
|
case errors::invalid =>
|
|
- getopt::printhelp(os::stderr, "powerctl", help...);
|
|
+ getopt::printhelp(os::stderr, "powerctl", help...)!;
|
|
os::exit(1);
|
|
};
|
|
const result = set_disk_state(state);
|
|
@@ -95,7 +95,7 @@ export fn main() void = {
|
|
case let state: mem_state =>
|
|
yield state;
|
|
case errors::invalid =>
|
|
- getopt::printhelp(os::stderr, "powerctl", help...);
|
|
+ getopt::printhelp(os::stderr, "powerctl", help...)!;
|
|
os::exit(1);
|
|
};
|
|
const result = set_mem_state(state);
|
|
@@ -105,7 +105,7 @@ export fn main() void = {
|
|
case let state: sleep_state =>
|
|
yield state;
|
|
case errors::invalid =>
|
|
- getopt::printhelp(os::stderr, "powerctl", help...);
|
|
+ getopt::printhelp(os::stderr, "powerctl", help...)!;
|
|
os::exit(1);
|
|
};
|
|
const result = set_sleep_state(state);
|
|
diff --git a/sysfs.ha b/sysfs.ha
|
|
index 3473086..df7f373 100644
|
|
--- a/sysfs.ha
|
|
+++ b/sysfs.ha
|
|
@@ -46,7 +46,7 @@ fn read_states(path: str) (strings::tokenizer | fs::error | io::error) = {
|
|
};
|
|
|
|
fn write_sysfs_file(path: str, content: str) (void | fs::error | io::error) = {
|
|
- const file = os::open(path, fs::flags::WRONLY | fs::flags::TRUNC)?;
|
|
+ const file = os::open(path, fs::flag::WRONLY | fs::flag::TRUNC)?;
|
|
defer io::close(file)!;
|
|
io::write(file, strings::toutf8(content))?;
|
|
};
|
|
--
|
|
2.42.0
|
|
|