summaryrefslogtreecommitdiff
path: root/debian/patches/8.13/8.13.7/qtool.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/8.13/8.13.7/qtool.patch')
-rw-r--r--debian/patches/8.13/8.13.7/qtool.patch101
1 files changed, 101 insertions, 0 deletions
diff --git a/debian/patches/8.13/8.13.7/qtool.patch b/debian/patches/8.13/8.13.7/qtool.patch
new file mode 100644
index 0000000..dc288b2
--- /dev/null
+++ b/debian/patches/8.13/8.13.7/qtool.patch
@@ -0,0 +1,101 @@
+*** ./sendmail-8.13.7/contrib/qtool.pl Wed Mar 5 16:11:54 2003
+--- ./sendmail-8.13.7/contrib/qtool.pl Wed Mar 5 15:59:10 2003
+***************
+*** 355,373 ****
+ sub lock_file
+ {
+ my $file_name = shift;
+ my $result;
+
+ $result = sysopen(FILE_TO_LOCK, $file_name, Fcntl::O_RDWR);
+ if (!$result)
+ {
+ return (undef, "Unable to open '$file_name': $!");
+ }
+
+! $result = flock(FILE_TO_LOCK, Fcntl::LOCK_EX | Fcntl::LOCK_NB);
+! if (!$result)
+ {
+ return (undef, "Could not obtain lock on '$file_name': $!");
+ }
+
+ return (\*FILE_TO_LOCK, undef);
+ }
+--- 355,394 ----
+ sub lock_file
+ {
+ my $file_name = shift;
+ my $result;
+
++ my $FLOCK_STRUCT;
++ my $fcntllock;
++
++ # Supposedly under linux
++ # my $FLOCK_STRUCT = 's s l l i';
++ # But I think perl's using __off64_t instead of __off_t
++ # my $FLOCK_STRUCT = 's s l l l l i';
++ # Screw it, its all zero anyway...
++
++ $FLOCK_STRUCT = 's H60';
++ $fcntllock = pack($FLOCK_STRUCT, F_WRLCK,
++ "000000000000000000000000000000000000000000000000000000000000");
++
+ $result = sysopen(FILE_TO_LOCK, $file_name, Fcntl::O_RDWR);
+ if (!$result)
+ {
++ # print "Unable to open '$file_name': $!";
+ return (undef, "Unable to open '$file_name': $!");
+ }
+
+! $result = fcntl (FILE_TO_LOCK, F_SETLK, $fcntllock);
+!
+! # print "Fcntl Lock result on $file_name = $result\n";
+!
+! # $result = flock(FILE_TO_LOCK, Fcntl::LOCK_EX | Fcntl::LOCK_NB);
+! # print "Lock result on $file_name = $result\n";
+! # if (!$result)
+! if ($result ne "0 but true")
+ {
++ # print "Could not obtain lock on '$file_name': $!\n";
+ return (undef, "Could not obtain lock on '$file_name': $!");
+ }
+
+ return (\*FILE_TO_LOCK, undef);
+ }
+***************
+*** 387,399 ****
+
+ sub unlock_file
+ {
+ my $file = shift;
+ my $result;
+
+! $result = flock($file, Fcntl::LOCK_UN);
+! if (!$result)
+ {
+ return "Unlock failed on '$result': $!";
+ }
+
+ return undef;
+--- 408,428 ----
+
+ sub unlock_file
+ {
+ my $file = shift;
+ my $result;
++ my $FLOCK_STRUCT;
++ my $fcntllock;
+
+! $FLOCK_STRUCT = 's H60';
+! $fcntllock = pack($FLOCK_STRUCT, F_UNLCK,
+! "000000000000000000000000000000000000000000000000000000000000");
+! $result = fcntl (FILE_TO_LOCK, F_SETLK, $fcntllock);
+!
+! if ($result ne "0 but true")
+! # $result = flock($file, Fcntl::LOCK_UN);
+! # if (!$result)
+ {
+ return "Unlock failed on '$result': $!";
+ }
+
+ return undef;