diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-10-09 15:38:06 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-10 12:23:12 +0200 |
commit | 539fb085513d6627319c3e9c86e90e5ae938f326 (patch) | |
tree | 031a5b94578b1f63a1666c6c158a478d8e59ff7f /Userland/Utilities | |
parent | 828441852f803a67c771910702baefe12cf2d995 (diff) | |
download | serenity-539fb085513d6627319c3e9c86e90e5ae938f326.zip |
Userland: Remove unecessary uses of __serenity__ macro
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/adjtime.cpp | 4 | ||||
-rw-r--r-- | Userland/Utilities/gml-format.cpp | 4 | ||||
-rw-r--r-- | Userland/Utilities/js.cpp | 2 | ||||
-rw-r--r-- | Userland/Utilities/ntpquery.cpp | 14 |
4 files changed, 0 insertions, 24 deletions
diff --git a/Userland/Utilities/adjtime.cpp b/Userland/Utilities/adjtime.cpp index ba56cf8be1..18e8ecd45e 100644 --- a/Userland/Utilities/adjtime.cpp +++ b/Userland/Utilities/adjtime.cpp @@ -13,9 +13,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) { -#ifdef __serenity__ TRY(Core::System::pledge("stdio settime")); -#endif Core::ArgsParser args_parser; Optional<double> delta; @@ -34,9 +32,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(Core::System::adjtime(&delta_timeval, nullptr)); } -#ifdef __serenity__ TRY(Core::System::pledge("stdio")); -#endif timeval remaining_delta_timeval; TRY(Core::System::adjtime(nullptr, &remaining_delta_timeval)); diff --git a/Userland/Utilities/gml-format.cpp b/Userland/Utilities/gml-format.cpp index cd8cf97aa3..7c44d1d45d 100644 --- a/Userland/Utilities/gml-format.cpp +++ b/Userland/Utilities/gml-format.cpp @@ -48,9 +48,7 @@ ErrorOr<bool> format_file(StringView path, bool inplace) ErrorOr<int> serenity_main(Main::Arguments args) { -#ifdef __serenity__ TRY(Core::System::pledge("stdio rpath wpath cpath")); -#endif bool inplace = false; Vector<String> files; @@ -61,10 +59,8 @@ ErrorOr<int> serenity_main(Main::Arguments args) args_parser.add_positional_argument(files, "File(s) to process", "path", Core::ArgsParser::Required::No); args_parser.parse(args); -#ifdef __serenity__ if (!inplace) TRY(Core::System::pledge("stdio rpath")); -#endif if (files.is_empty()) files.append("-"); diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index 9afd29ce4e..67e1f83848 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -1505,9 +1505,7 @@ private: ErrorOr<int> serenity_main(Main::Arguments arguments) { -#ifdef __serenity__ TRY(Core::System::pledge("stdio rpath wpath cpath tty sigaction")); -#endif bool gc_on_every_allocation = false; bool disable_syntax_highlight = false; diff --git a/Userland/Utilities/ntpquery.cpp b/Userland/Utilities/ntpquery.cpp index 11e8a477d8..d45051f4a5 100644 --- a/Userland/Utilities/ntpquery.cpp +++ b/Userland/Utilities/ntpquery.cpp @@ -90,15 +90,9 @@ static String format_ntp_timestamp(NtpTimestamp ntp_timestamp) buffer[written] = '\0'; return buffer; } -#ifdef __serenity__ ErrorOr<int> serenity_main(Main::Arguments arguments) -#else -int main(int argc, char** argv) -#endif { -#ifdef __serenity__ TRY(Core::System::pledge("stdio inet unix settime")); -#endif bool adjust_time = false; bool set_time = false; @@ -119,22 +113,16 @@ int main(int argc, char** argv) args_parser.add_option(set_time, "Immediately set system time (requires root)", "set", 's'); args_parser.add_option(verbose, "Verbose output", "verbose", 'v'); args_parser.add_positional_argument(host, "NTP server", "host", Core::ArgsParser::Required::No); -#ifdef __serenity__ args_parser.parse(arguments); -#else - args_parser.parse(argc, argv); -#endif if (adjust_time && set_time) { warnln("-a and -s are mutually exclusive"); return 1; } -#ifdef __serenity__ if (!adjust_time && !set_time) { TRY(Core::System::pledge("stdio inet unix")); } -#endif auto* hostent = gethostbyname(host); if (!hostent) { @@ -142,10 +130,8 @@ int main(int argc, char** argv) return 1; } -#ifdef __serenity__ TRY(Core::System::pledge((adjust_time || set_time) ? "stdio inet settime"sv : "stdio inet"sv)); TRY(Core::System::unveil(nullptr, nullptr)); -#endif int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (fd < 0) { |