[tools 1/3] testbot/web: Document the Fcntl usage.

Francois Gouget fgouget at codeweavers.com
Wed Mar 30 12:06:50 CDT 2022


Use Fcntl qw(O_RDONLY) for simple cases. This is better than adding a
comment which may get out-of-date if more constants are needed.
But still use a comment to avoid too much duplication in more complex
cases.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/Engine.pl            | 2 +-
 testbot/lib/WineTestBot/Utils.pm | 2 +-
 testbot/web/GetFile.pl           | 2 +-
 testbot/web/GetTaskFile.pl       | 2 +-
 testbot/web/Screenshot.pl        | 2 +-
 testbot/web/Submit.pl            | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index db9d82d30..7880b8e80 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -37,7 +37,7 @@ sub BEGIN
 }
 
 use Errno qw(EAGAIN);
-use Fcntl;
+use Fcntl; # For O_XXX and FD_XXX
 use MIME::Parser;
 use POSIX ":sys_wait_h";
 use Socket;
diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm
index 27b222fd2..5315c75d4 100644
--- a/testbot/lib/WineTestBot/Utils.pm
+++ b/testbot/lib/WineTestBot/Utils.pm
@@ -33,7 +33,7 @@ our @EXPORT = qw(SecureConnection MakeSecureURL GetTaskURL GenerateRandomString
                  BuildTag SanitizeTag LocaleName NotifyAdministrator
                  BatchQuote ShQuote ShArgv2Cmd);
 
-use Fcntl;
+use Fcntl qw(O_CREAT O_EXCL O_WRONLY);
 
 use WineTestBot::Config;
 
diff --git a/testbot/web/GetFile.pl b/testbot/web/GetFile.pl
index a8699497b..59602bf19 100644
--- a/testbot/web/GetFile.pl
+++ b/testbot/web/GetFile.pl
@@ -21,7 +21,7 @@ use strict;
 
 use Apache2::Const -compile => qw(REDIRECT);
 use CGI;
-use Fcntl; # For O_XXX
+use Fcntl qw(O_RDONLY);
 use WineTestBot::Jobs;
 
 
diff --git a/testbot/web/GetTaskFile.pl b/testbot/web/GetTaskFile.pl
index 41111197d..0b7f167d2 100644
--- a/testbot/web/GetTaskFile.pl
+++ b/testbot/web/GetTaskFile.pl
@@ -22,7 +22,7 @@ use strict;
 
 use Apache2::Const -compile => qw(REDIRECT);
 use CGI;
-use Fcntl; # for O_READONLY
+use Fcntl qw(O_RDONLY);
 use WineTestBot::Config;
 
 
diff --git a/testbot/web/Screenshot.pl b/testbot/web/Screenshot.pl
index a8a3d88ed..685c4a45c 100644
--- a/testbot/web/Screenshot.pl
+++ b/testbot/web/Screenshot.pl
@@ -22,7 +22,7 @@ use strict;
 use Apache2::Const -compile => qw(REDIRECT);
 use CGI;
 use CGI::Cookie;
-use Fcntl;
+use Fcntl qw(O_RDONLY);
 use WineTestBot::Config;
 use WineTestBot::CGI::Sessions;
 use WineTestBot::Engine::Notify;
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 472622dd5..e2173d898 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -26,7 +26,7 @@ use ObjectModel::CGI::FreeFormPage;
 our @ISA = qw(ObjectModel::CGI::FreeFormPage);
 
 use CGI qw(:standard);
-use Fcntl; # For O_XXX
+use Fcntl qw(O_RDONLY);
 use IO::Handle;
 use POSIX qw(:fcntl_h); # For SEEK_XXX
 use File::Basename;
-- 
2.30.2




More information about the wine-devel mailing list