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
1a6af882
...
1a6af8826202e071e09e3d87e266c7370e37390d
authored
2001-11-11 17:04:41 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
* lib/mu_dbm.c: Add <errno.h>.
Remove trailing spaces.
1 parent
feb11247
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
23 deletions
ChangeLog
lib/mu_dbm.c
mailbox/mbx_pop.c
ChangeLog
View file @
1a6af88
2001-11-11 Alain Magloire
* lib/mu_dbm.c: Add <errno.h>.
Remove trailing spaces.
2001-11-11 Sergey Poznyakoff
* lib/mu_dbm.c: (new) These functions provide an
...
...
@@ -17,7 +22,7 @@
* pop3d/apop.c: Bunch of changes due to introduction of new
DBM interface.
* pop3d/pop3d.h: Likewise.
* comsat/Makefile.am: Added comsat.h to sources
2001-11-10 Jeff Bailey <jbailey@outpost.dnsalias.org>
...
...
@@ -34,7 +39,7 @@
* doc/man/pop3d.1: New File
* doc/man/imap4d.1: New File
* doc/man/Makefile.am: New File
* pop3d/pop3d.c: Change timeout to unsigned int from size_t.
...
...
lib/mu_dbm.c
View file @
1a6af88
...
...
@@ -29,13 +29,14 @@
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#include <errno.h>
#include <mu_dbm.h>
int
mu_fcheck_perm
(
int
fd
,
int
mode
)
{
struct
stat
st
;
if
(
fstat
(
fd
,
&
st
)
==
-
1
)
{
if
(
errno
==
ENOENT
)
...
...
@@ -47,12 +48,12 @@ mu_fcheck_perm (int fd, int mode)
return
1
;
return
0
;
}
int
mu_check_perm
(
char
*
name
,
int
mode
)
{
struct
stat
st
;
if
(
stat
(
name
,
&
st
)
==
-
1
)
{
if
(
errno
==
ENOENT
)
...
...
@@ -74,7 +75,7 @@ mu_dbm_open(char *name, DBM_FILE *db, int flags, int mode)
{
int
f
;
char
*
pfname
;
pfname
=
xmalloc
(
strlen
(
name
)
+
sizeof
DB_SUFFIX
);
strcat
(
strcpy
(
pfname
,
name
),
DB_SUFFIX
);
if
(
mu_check_perm
(
pfname
,
mode
))
...
...
@@ -82,7 +83,7 @@ mu_dbm_open(char *name, DBM_FILE *db, int flags, int mode)
free
(
pfname
);
return
-
1
;
}
switch
(
flags
)
{
case
MU_STREAM_CREAT
:
...
...
@@ -147,7 +148,7 @@ mu_dbm_open(char *name, DBM_FILE *dbm, int flags, int mode)
int
f
,
rc
;
DB
*
db
;
char
*
pfname
;
pfname
=
xmalloc
(
strlen
(
name
)
+
sizeof
DB_SUFFIX
);
strcat
(
strcpy
(
pfname
,
name
),
DB_SUFFIX
);
if
(
mu_check_perm
(
pfname
,
mode
))
...
...
@@ -155,7 +156,7 @@ mu_dbm_open(char *name, DBM_FILE *dbm, int flags, int mode)
free
(
pfname
);
return
-
1
;
}
switch
(
flags
)
{
case
MU_STREAM_CREAT
:
...
...
@@ -177,7 +178,7 @@ mu_dbm_open(char *name, DBM_FILE *dbm, int flags, int mode)
free
(
pfname
);
if
(
rc
)
return
-
1
;
*
dbm
=
malloc
(
sizeof
**
dbm
);
if
(
!*
dbm
)
{
...
...
@@ -225,14 +226,14 @@ mu_dbm_firstkey (DBM_FILE db)
if
(
db
->
db
->
cursor
(
db
->
db
,
NULL
,
&
db
->
dbc
,
0
)
!=
0
)
return
key
;
}
if
((
ret
=
db
->
dbc
->
c_get
(
db
->
dbc
,
&
key
,
&
data
,
DB_FIRST
))
!=
0
)
{
key
.
data
=
NULL
;
key
.
size
=
0
;
if
(
ret
==
DB_NOTFOUND
)
errno
=
ENOENT
;
else
else
errno
=
ret
;
}
return
key
;
...
...
@@ -246,17 +247,17 @@ mu_dbm_nextkey (DBM_FILE db, DBM_DATUM pkey /*unused*/)
memset
(
&
key
,
0
,
sizeof
key
);
memset
(
&
data
,
0
,
sizeof
data
);
if
(
!
db
->
dbc
)
return
key
;
if
((
ret
=
db
->
dbc
->
c_get
(
db
->
dbc
,
&
key
,
&
data
,
DB_NEXT
))
!=
0
)
{
key
.
data
=
NULL
;
key
.
size
=
0
;
if
(
ret
==
DB_NOTFOUND
)
errno
=
ENOENT
;
else
else
errno
=
ret
;
}
return
key
;
...
...
@@ -270,7 +271,7 @@ int
mu_dbm_open
(
char
*
name
,
DBM_FILE
*
db
,
int
flags
,
int
mode
)
{
int
f
;
switch
(
flags
)
{
case
MU_STREAM_CREAT
:
...
...
@@ -296,7 +297,7 @@ mu_dbm_open(char *name, DBM_FILE *db, int flags, int mode)
dbm_close
(
*
db
);
return
1
;
}
return
0
;
}
...
...
@@ -339,7 +340,7 @@ int
mu_dbm_open
(
char
*
name
,
DBM_FILE
*
db
,
int
flags
,
int
mode
)
{
int
f
;
switch
(
flags
)
{
case
MU_STREAM_CREAT
:
...
...
@@ -359,12 +360,12 @@ mu_dbm_open(char *name, DBM_FILE *db, int flags, int mode)
{
char
*
p
;
int
fd
;
p
=
xmalloc
(
strlen
(
name
)
+
5
);
strcat
(
strcpy
(
p
,
name
),
".pag"
);
fd
=
open
(
p
,
f
,
mode
);
free
(
p
);
if
(
fd
<
0
)
if
(
fd
<
0
)
return
-
1
;
close
(
fd
);
...
...
@@ -372,11 +373,11 @@ mu_dbm_open(char *name, DBM_FILE *db, int flags, int mode)
strcat
(
strcpy
(
p
,
name
),
".dir"
);
fd
=
open
(
p
,
f
,
mode
);
free
(
p
);
if
(
fd
<
0
)
if
(
fd
<
0
)
return
-
1
;
close
(
fd
);
}
return
dbminit
(
name
);
}
...
...
mailbox/mbx_pop.c
View file @
1a6af88
...
...
@@ -492,7 +492,6 @@ pop_open (mailbox_t mbox, int flags)
{
pop_data_t
mpd
=
mbox
->
data
;
int
status
;
void
*
func
=
(
void
*
)
pop_open
;
char
*
host
;
size_t
hostlen
=
0
;
long
port
=
110
;
...
...
Please
register
or
sign in
to post a comment