Francois Gouget : testbot/web: Document the Fcntl usage.

Alexandre Julliard julliard at winehq.org
Wed Mar 30 15:17:55 CDT 2022


Module: tools
Branch: master
Commit: d29fd0fddd8fde89e5b2fdf71ee38aefd096b601
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=d29fd0fddd8fde89e5b2fdf71ee38aefd096b601

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Mar 30 19:06:50 2022 +0200

testbot/web: Document the Fcntl usage.

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 db9d82d..7880b8e 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 27b222f..5315c75 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 a869949..59602bf 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 4111119..0b7f167 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 a8a3d88..685c4a4 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 472622d..e2173d8 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;




More information about the wine-cvs mailing list