mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibCore: Rename File::ShouldCloseFile{Description => Descriptor}
From https://youtu.be/YNSAZIW3EM0?t=1474: "Hmm... I don't think that name is right! From the perspective of userspace, this is a file descriptor. File description is what the kernel internally keeps track of, but as far as userspace is concerned, he just has a file descriptor. [...] Maybe that name should be changed." Core::File even has a member of this enum type... called m_should_close_file_descriptor - so let's just rename it :^)
This commit is contained in:
parent
664794b19e
commit
82956a08b3
9 changed files with 16 additions and 16 deletions
|
@ -54,7 +54,7 @@ int main(int argc, char** argv)
|
|||
bool success = file->open(
|
||||
STDIN_FILENO,
|
||||
Core::IODevice::OpenMode::ReadOnly,
|
||||
Core::File::ShouldCloseFileDescription::Yes);
|
||||
Core::File::ShouldCloseFileDescriptor::Yes);
|
||||
ASSERT(success);
|
||||
buffer = file->read_all();
|
||||
} else {
|
||||
|
|
|
@ -75,7 +75,7 @@ int main(int argc, char** argv)
|
|||
|
||||
for (auto path : paths) {
|
||||
if (StringView { path } == "-") {
|
||||
success = file->open(STDIN_FILENO, Core::IODevice::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescription::No);
|
||||
success = file->open(STDIN_FILENO, Core::IODevice::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescriptor::No);
|
||||
} else {
|
||||
file->set_filename(path);
|
||||
success = file->open(Core::IODevice::OpenMode::ReadOnly);
|
||||
|
|
|
@ -58,7 +58,7 @@ static Options parse_options(int argc, char* argv[])
|
|||
bool success = c_stdin->open(
|
||||
STDIN_FILENO,
|
||||
Core::IODevice::OpenMode::ReadOnly,
|
||||
Core::File::ShouldCloseFileDescription::No);
|
||||
Core::File::ShouldCloseFileDescriptor::No);
|
||||
ASSERT(success);
|
||||
auto buffer = c_stdin->read_all();
|
||||
dbg() << "Read size " << buffer.size();
|
||||
|
|
|
@ -44,7 +44,7 @@ int main(int argc, char** argv)
|
|||
URL url;
|
||||
bool success;
|
||||
if (argc < 2) {
|
||||
success = f->open(STDIN_FILENO, Core::IODevice::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescription::No);
|
||||
success = f->open(STDIN_FILENO, Core::IODevice::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescriptor::No);
|
||||
} else {
|
||||
url = URL::create_with_file_protocol(argv[1]);
|
||||
f->set_filename(argv[1]);
|
||||
|
|
|
@ -67,7 +67,7 @@ int main(int argc, char* argv[])
|
|||
auto file = Core::File::construct();
|
||||
bool success;
|
||||
if (file_name == nullptr) {
|
||||
success = file->open(STDIN_FILENO, Core::IODevice::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescription::No);
|
||||
success = file->open(STDIN_FILENO, Core::IODevice::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescriptor::No);
|
||||
} else {
|
||||
file->set_filename(file_name);
|
||||
success = file->open(Core::IODevice::OpenMode::ReadOnly);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue