~ubuntu-branches/debian/sid/sendmail/sid

« back to all changes in this revision

Viewing changes to debian/patches/8.13/8.13.8/qtool.patch

  • Committer: Bazaar Package Importer
  • Author(s): Richard A Nelson (Rick)
  • Date: 2007-05-05 20:10:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070505201000-xd515upx318zlkgh
Tags: 8.14.1-1
* *** *** libmilter gets a new version *** ***
  *** *** MimeDefang and other packages will need to be rebuilt *** ***

* New upstream release
  - Fix 8.14.0 regressions & issues
* Refit patches
* Drop qtool patch, equivalent applied upstream
* Force configure defaults (new machine, gotta get it right)
* update configure.ac for newer db versions
* refresh FAQ
* build against db4.5                                      closes: #421945
* build-indep-depends on groff, not groff-base             closes: #362872

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
*** ./sendmail-8.13.8/contrib/qtool.pl  Wed Mar  5 16:11:54 2003
2
 
--- ./sendmail-8.13.8/contrib/qtool.pl  Wed Mar  5 15:59:10 2003
3
 
***************
4
 
*** 355,373 ****
5
 
  sub lock_file
6
 
  {
7
 
        my $file_name = shift;
8
 
        my $result;
9
 
 
10
 
        $result = sysopen(FILE_TO_LOCK, $file_name, Fcntl::O_RDWR);
11
 
        if (!$result)
12
 
        {
13
 
                return (undef, "Unable to open '$file_name': $!");
14
 
        }
15
 
 
16
 
!       $result = flock(FILE_TO_LOCK, Fcntl::LOCK_EX | Fcntl::LOCK_NB);
17
 
!       if (!$result)
18
 
        {
19
 
                return (undef, "Could not obtain lock on '$file_name': $!");
20
 
        }
21
 
 
22
 
        return (\*FILE_TO_LOCK, undef);
23
 
  }
24
 
--- 355,394 ----
25
 
  sub lock_file
26
 
  {
27
 
        my $file_name = shift;
28
 
        my $result;
29
 
 
30
 
+       my $FLOCK_STRUCT;
31
 
+       my $fcntllock;
32
 
33
 
+       # Supposedly under linux
34
 
+       # my $FLOCK_STRUCT = 's s l l i';
35
 
+       # But I think perl's using __off64_t instead of __off_t
36
 
+       # my $FLOCK_STRUCT = 's s l l l l i';
37
 
+       # Screw it, its all zero anyway...
38
 
+       
39
 
+       $FLOCK_STRUCT = 's H60';
40
 
+       $fcntllock = pack($FLOCK_STRUCT, F_WRLCK, 
41
 
+         "000000000000000000000000000000000000000000000000000000000000");
42
 
43
 
        $result = sysopen(FILE_TO_LOCK, $file_name, Fcntl::O_RDWR);
44
 
        if (!$result)
45
 
        {
46
 
+               # print "Unable to open '$file_name': $!";
47
 
                return (undef, "Unable to open '$file_name': $!");
48
 
        }
49
 
 
50
 
!         $result = fcntl (FILE_TO_LOCK, F_SETLK, $fcntllock);
51
 
52
 
!       # print "Fcntl Lock result on $file_name = $result\n";
53
 
54
 
!       # $result = flock(FILE_TO_LOCK, Fcntl::LOCK_EX | Fcntl::LOCK_NB);
55
 
!       # print "Lock result on $file_name = $result\n";
56
 
!       # if (!$result)
57
 
!       if ($result ne "0 but true") 
58
 
        {
59
 
+               # print "Could not obtain lock on '$file_name': $!\n";
60
 
                return (undef, "Could not obtain lock on '$file_name': $!");
61
 
        }
62
 
 
63
 
        return (\*FILE_TO_LOCK, undef);
64
 
  }
65
 
***************
66
 
*** 387,399 ****
67
 
 
68
 
  sub unlock_file
69
 
  {
70
 
        my $file = shift;
71
 
        my $result;
72
 
 
73
 
!       $result = flock($file, Fcntl::LOCK_UN);
74
 
!       if (!$result)
75
 
        {
76
 
                return "Unlock failed on '$result': $!";
77
 
        }
78
 
 
79
 
        return undef;
80
 
--- 408,428 ----
81
 
 
82
 
  sub unlock_file
83
 
  {
84
 
        my $file = shift;
85
 
        my $result;
86
 
+       my $FLOCK_STRUCT;
87
 
+       my $fcntllock;
88
 
 
89
 
!       $FLOCK_STRUCT = 's H60';
90
 
!       $fcntllock = pack($FLOCK_STRUCT, F_UNLCK, 
91
 
!         "000000000000000000000000000000000000000000000000000000000000");
92
 
!         $result = fcntl (FILE_TO_LOCK, F_SETLK, $fcntllock);
93
 
94
 
!         if ($result ne "0 but true")
95
 
!       # $result = flock($file, Fcntl::LOCK_UN);
96
 
!       # if (!$result)
97
 
        {
98
 
                return "Unlock failed on '$result': $!";
99
 
        }
100
 
 
101
 
        return undef;