Commit Graph

931 Commits

Author SHA1 Message Date
Lucas CHOLLET
dbcccde062 hexdump: Port to LibMain 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
02cb34a48a head: Port to LibMain 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
5ac52d0e4c gunzip: Remove StringView assignment on rhs-value 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
80a1ab3487 gunzip: Port to LibMain 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
c2e7acc8bb grep: Port to LibMain 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
9e1e80954b gml-format: Port to LibMain 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
f862fabe6e false: Port to LibMain 2022-01-14 19:42:19 +02:00
Lucas CHOLLET
affef5d1a9 disasm: Port to LibMain 2022-01-14 19:42:19 +02:00
kleines Filmröllchen
be6418cc50 Everywhere: Use my new serenityos.org e-mail :^) 2022-01-14 11:54:09 +01:00
Idan Horowitz
cfb9f889ac LibELF: Accept Span instead of Pointer+Size in validate_program_headers 2022-01-13 22:40:25 +01:00
Idan Horowitz
3e959618c3 LibELF: Use StringBuilders instead of Strings for the interpreter path
This is required for the Kernel's usage of LibELF, since Strings do not
expose allocation failure.
2022-01-13 22:40:25 +01:00
Timothy Flynn
27c845eef2 js: Pretty-print the Intl.DisplayNames [[LanguageDisplay]] internal slot 2022-01-13 13:43:57 +01:00
sin-ack
aedb013ee3 LibIMAP+Userland: Convert LibIMAP::Client to the Serenity Stream APIs
You now cannot get an unconnected LibIMAP::Client, but you can still
close it. This makes for a nicer API where we don't have a Client object
in a limbo state between being constructed and being connected.

This code still isn't as nice as it should be, as TLS::TLSv12 is still
not a Core::Stream::Socket subclass, which would allow for consolidating
most of the TLS/non-TLS code into a single implementation.
2022-01-13 15:16:12 +03:30
sin-ack
53e9d757fe test-imap: Convert test-imap to LibMain 2022-01-13 15:16:12 +03:30
kleines Filmröllchen
9ec2b379a4 Meta: Fix Markdown linting
The new help://man links were linted incorrectly, and they're now
skipped by the markdown linter, such as in the pre-commit hook
2022-01-12 13:13:24 +01:00
Junior Rantila
0d328f3c86 LibCore+flock: Make Core::System::waitpid more ergonomic 2022-01-11 16:04:29 +01:00
kleines Filmröllchen
9e471353dd Meta: Convert new help page link styles for the man page website
The special URL links (help://man) and the application opening links now
work on the man page website. While the page links are translated
correctly, the application launch can't be implemented. For this reason,
an explanatory error page is shown instead.
2022-01-11 00:24:57 +01:00
Federico Guerinoni
9aa556fdf0 Userland: Port wasm to LibMain 2022-01-09 04:26:16 -08:00
Federico Guerinoni
05f0f70b00 Userland: Port tac to LibMain 2022-01-09 04:26:16 -08:00
Junior Rantila
abaee3a325 beep: Port to LibMain :^) 2022-01-09 11:16:00 +03:30
Michel Hermier
69cabb3ead Everywhere: Add serenity_dev_{makedev,major,minor}
Add them in `<Kernel/API/Device.h>` and use these to provides
`{makedev,major,minor}` in `<sys/sysmacros.h>`. It aims to be more in
line with other Unix implementations and avoid code duplication in user
land.
2022-01-09 00:58:44 +01:00
Linus Groh
eb60d16549 LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value>
Instead of making it a void function, checking for an exception, and
then receiving the relevant result via VM::last_value(), we can
consolidate all of this by using completions.

This allows us to remove more uses of VM::exception(), and all uses of
VM::last_value().
2022-01-08 23:43:03 +01:00
Andreas Kling
95df924e0e Kernel: Remove EWHYTHO error code :^)
This error code was a hack for catching error handling mistakes in the
kernel. It's no longer used anywhere.
2022-01-08 20:10:58 +01:00
Rummskartoffel
ba0d46e31a gzip: Don't fail when trying to compress empty files
Given an empty file, gzip would try to create a zero-size memory mapping
of that file, which would fail with EINVAL.
2022-01-08 15:29:38 +01:00
Rummskartoffel
748218d5d0 gzip: Port to LibMain 2022-01-08 15:29:38 +01:00
Marcus Nilsson
d2b99010e4 jp: Use File::standard_input() when reading from stdin
Trying to open '/dev/stdin' resulted in ENOENT. Instead use the
standard_input() helper to get the File.
2022-01-08 06:19:09 -08:00
Liav A
ff25958b51 Userland: Introduce the pmemdump utility
This utility helps to dump the physical memory space from /dev/mem.
It supports both read(2) and mmap(2) on it so we could use mmap(2) for
fast dumping of the memory, or read(2) when we need to read unaligned
physical regions.
2022-01-08 13:21:16 +02:00
Rummskartoffel
f9c4f65e1f less: Fix crash on empty input 2022-01-08 11:56:37 +01:00
Julian Eigmüller
fec0829c86 man: Fix error handling when section is specified
Previously, man would only check if a path is not associated with a
manpage when no section was specified via the command line.

So `man gibberish` would fail with "no man page for gibberish", but `man
2 gibberish` would fail with a runtime error and still open a pipe to
  the pager leading to a nasty crash.

Moving the check outside the "if (!section)" block fixes this.

Also: if a section is specified, the error message now echoes it back
(no manpage for foo in section bar).
2022-01-07 21:31:46 +01:00
mjz19910
10ec98dd38 Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Brian Gianforcaro
6bf91d00ef run-tests: Make reproducing test failures behave closer to selftest mode
In CI / or local testing when you run `serenity.sh tests`, the system
will boot itself in self test mode, and the test runner will be launched
by SystemServer. Previously we were setting up settings for that
environment in the `SystemServer.ini`. This makes reproducing CI
failures a bit confusing, as the system will behavior differently if you
run in self-test mode, vs running `run-tests-and-shutdown.sh` or
`run-tests` manually in a session.

This change moves the settings to `run-tests`, so no matter how you try
to run the test runner, it will always behave the same.
2022-01-07 01:19:09 -08:00
Lucas CHOLLET
080c3164c7 du: Display true size of directory instead of 4 KiB
For each directory, we now go through each file and sum-up the contents.
2022-01-06 18:19:31 +01:00
RasmusNylander
4e65c4dae4 LibKeyboard: Change some Optional<T> returns to ErrorOr<T>
Makes CharacterMapFile::load_from_file and CharacterMap::load_from_file
return ErrorOr instead of Optional. This makes them a little nicer to
use and a little easier to read, as they seem to have been approximating
this.
2022-01-06 17:54:03 +01:00
Jun Zhang
0ac7931545 Utilities/ln: Port to LibMain
This patch simply ports the utility ln to LibMain :^)
2022-01-06 13:32:22 +01:00
Linus Groh
9d0d3affd4 LibJS: Replace the custom unwind mechanism with completions :^)
This includes:

- Parsing proper LabelledStatements with try_parse_labelled_statement()
- Removing LabelableStatement
- Implementing the LoopEvaluation semantics via loop_evaluation() in
  each IterationStatement subclass; and IterationStatement evaluation
  via {For,ForIn,ForOf,ForAwaitOf,While,DoWhile}Statement::execute()
- Updating ReturnStatement, BreakStatement and ContinueStatement to
  return the appropriate completion types
- Basically reimplementing TryStatement and SwitchStatement according to
  the spec, using completions
- Honoring result completion types in AsyncBlockStart and
  OrdinaryCallEvaluateBody
- Removing any uses of the VM unwind mechanism - most importantly,
  VM::throw_exception() now exclusively sets an exception and no longer
  triggers any unwinding mechanism.
  However, we already did a good job updating all of LibWeb and userland
  applications to not use it, and the few remaining uses elsewhere don't
  rely on unwinding AFAICT.
2022-01-06 12:36:23 +01:00
mjz19910
1f1383fe1e unzip: Remove useless .characters() calls 2022-01-04 23:53:46 -08:00
mjz19910
2351bb2db9 Utilities/CMakeList: Remove duplicate target_link_libraries(...) 2022-01-04 19:14:57 -08:00
mjz19910
87b719a494 Utilities/CMakeList: Sort target_link_libraries(...) 2022-01-04 19:14:57 -08:00
Linus Groh
9e50bd91a6 js: Remove uses of TRY_OR_DISCARD()
Slightly more verbose, but that's the last user of TRY_OR_DISCARD gone!
2022-01-04 23:37:26 +00:00
Marco Cutecchia
732e41714a ls: Fix duplicated error message when opening a directory fails 2022-01-04 22:47:57 +01:00
Marco Cutecchia
70f707d806 stat: Print an error if 'stat' fails 2022-01-04 22:47:57 +01:00
Michel Hermier
22efc34ec5 LibCrypto: Make Digests able to return bytes 2022-01-05 01:07:21 +03:30
Michel Hermier
25251f1b05 checksum: Use :hex-dump to format digest value 2022-01-05 01:07:21 +03:30
Michel Hermier
23fe07a148 checksum: Make name detection working even with a path 2022-01-05 01:07:21 +03:30
mjz19910
154d33f240 unzip: Port to LibMain 2022-01-04 10:59:42 +00:00
mjz19910
7c05db19a1 zip: Port to LibMain :^) 2022-01-04 10:59:42 +00:00
Mathieu PATUREL
571d090609 profile: Specify the /proc/profile path in the help message 2022-01-04 07:56:54 +00:00
Mathieu PATUREL
cdbcb70913 profile: Don't print anything when disabling profiling
Just like when enabling profiling. Plus it's more unixy to not print
anything on success
2022-01-04 07:56:54 +00:00
Andrew Kaster
f8ea9cd64e Userland: Resolve unused-but-set-varaible warnings
These are almost always bugs, so enable globally.

Remove unused counter variables in SystemMonitor and disk_benchmark.
2022-01-04 07:51:31 +00:00
Andrew Kaster
170a7e263c Userland: Fail Core::find_executable_in_path on empty inputs
Before this patch, `which ""` or `type ""` would say that the empty
string is `/usr/local/bin/`.

Convert callers to consistently call is_empty() on the returned string
while we're at it, to support eventually removing the is_null() String
state in the future.
2022-01-04 07:38:42 +00:00