Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
23b36b08
...
23b36b086d37c59be3160fe13b90e30d22357322
authored
2001-09-09 20:32:11 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fix: both pool_first and pool_last must be biased by MAX_OPEN_STREAMS
1 parent
0404f4cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
mailbox/mbx_mh.c
mailbox/mbx_mh.c
View file @
23b36b0
...
...
@@ -513,20 +513,20 @@ _mh_tempfile(struct _mh_data *mhd, char **namep)
#ifdef HAVE_MKSTEMP
{
int
save_mask
=
umask
(
077
);
int
save_mask
=
umask
(
077
);
fd
=
mkstemp
(
filename
);
umask
(
save_mask
);
}
#else
if
(
mktemp
(
filename
))
fd
=
open
(
filename
,
O_CREAT
|
O_EXCL
|
O_RDWR
,
0600
);
fd
=
open
(
filename
,
O_CREAT
|
O_EXCL
|
O_RDWR
,
0600
);
else
fd
=
-
1
;
#endif
if
(
fd
==
-
1
)
{
free
(
filename
);
free
(
filename
);
return
NULL
;
}
...
...
@@ -1003,7 +1003,7 @@ mh_pool_lookup (struct _mh_message *mhm)
{
if
(
mhd
->
msg_pool
[
i
]
==
mhm
)
return
1
;
if
(
++
i
>
MAX_OPEN_STREAMS
)
if
(
++
i
==
MAX_OPEN_STREAMS
)
i
=
0
;
}
return
0
;
...
...
@@ -1019,11 +1019,12 @@ mh_pool_open (struct _mh_message *mhm)
return
0
;
if
(
mh_pool_open_count
(
mhd
)
==
MAX_OPEN_STREAMS
)
{
mh_message_stream_close
(
mhd
->
msg_pool
[
mhd
->
pool_first
]);
mhd
->
pool_first
++
;
mh_message_stream_close
(
mhd
->
msg_pool
[
mhd
->
pool_first
++
]);
mhd
->
pool_first
%=
MAX_OPEN_STREAMS
;
}
mh_message_stream_open
(
mhm
);
mhd
->
msg_pool
[
mhd
->
pool_last
++
]
=
mhm
;
mhd
->
pool_last
%=
MAX_OPEN_STREAMS
;
}
/* Attach a stream to a given message structure. The latter is supposed
...
...
Please
register
or
sign in
to post a comment