diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-13 01:36:31 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-13 01:36:31 +0100 |
commit | 97c799576a478d3881bfff1196f0fa829d736994 (patch) | |
tree | fb9d43820e7e65318c2f0e3d9f67932aee3a78ae /AK/Vector.h | |
parent | 19b9401487e87dcbb43b52c6fe194e3b0e49f842 (diff) | |
download | serenity-97c799576a478d3881bfff1196f0fa829d736994.zip |
Add close-on-exec flag for file descriptors.
I was surprised to find that dup()'ed fds don't share the close-on-exec flag.
That means it has to be stored separately from the FileDescriptor object.
Diffstat (limited to 'AK/Vector.h')
-rw-r--r-- | AK/Vector.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/AK/Vector.h b/AK/Vector.h index 0c0a7c3e30..8824e10a46 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -142,6 +142,17 @@ public: m_impl->remove(index); } + Vector& operator=(const Vector<T>& other) + { + if (this != &other) { + clear(); + ensureCapacity(other.size()); + for (const auto& v : other) + unchecked_append(v); + } + return *this; + } + void append(Vector<T>&& other) { Vector<T> tmp = move(other); |