Message ID | 20201222135849.38052-2-kieran.bingham@ideasonboard.com |
---|---|
State | Accepted |
Commit | 8f4e16f014c820a0ecb85e28453b88c277bc859f |
Delegated to: | Kieran Bingham |
Headers | show |
Series |
|
Related | show |
Hi Kieran, Thank you for the patch. On Tue, Dec 22, 2020 at 01:58:48PM +0000, Kieran Bingham wrote: > Directories can not be opened as a file, so the exists() check should > not return true for a path which points to a directory. > > Directories are not handled by the File class. > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > test/file.cpp | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/test/file.cpp b/test/file.cpp > index f458f355ccad..b80667ae5b2f 100644 > --- a/test/file.cpp > +++ b/test/file.cpp > @@ -49,6 +49,11 @@ protected: > return TestFail; > } > > + if (File::exists("/dev")) { > + cerr << "Directories should not be treated as files" << endl; > + return TestFail; > + } > + > /* Test unnamed file. */ > File file; >
Hi Kieran, On 2020-12-22 13:58:48 +0000, Kieran Bingham wrote: > Directories can not be opened as a file, so the exists() check should > not return true for a path which points to a directory. > > Directories are not handled by the File class. > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> > --- > test/file.cpp | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/test/file.cpp b/test/file.cpp > index f458f355ccad..b80667ae5b2f 100644 > --- a/test/file.cpp > +++ b/test/file.cpp > @@ -49,6 +49,11 @@ protected: > return TestFail; > } > > + if (File::exists("/dev")) { > + cerr << "Directories should not be treated as files" << endl; > + return TestFail; > + } > + > /* Test unnamed file. */ > File file; > > -- > 2.25.1 > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/test/file.cpp b/test/file.cpp index f458f355ccad..b80667ae5b2f 100644 --- a/test/file.cpp +++ b/test/file.cpp @@ -49,6 +49,11 @@ protected: return TestFail; } + if (File::exists("/dev")) { + cerr << "Directories should not be treated as files" << endl; + return TestFail; + } + /* Test unnamed file. */ File file;
Directories can not be opened as a file, so the exists() check should not return true for a path which points to a directory. Directories are not handled by the File class. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- test/file.cpp | 5 +++++ 1 file changed, 5 insertions(+)