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
39429508
...
39429508b7e28756e6f3d9f3030eaa87c7333bd3
authored
2000-01-17 06:29:30 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
mbx_mbox.c mbx_unix.c
.
1 parent
ff8d17bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
mailbox/mbx_mbox.c
mailbox/mbx_unix.c
mailbox/mbx_mbox.c
View file @
3942950
...
...
@@ -24,6 +24,7 @@
#include <mbx_mbox.h>
#include <mbx_unix.h>
#include <mbx_mdir.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
...
...
@@ -52,12 +53,18 @@ int
mailbox_mbox_init
(
mailbox_t
*
mbox
,
const
char
*
name
)
{
struct
stat
st
;
char
*
scheme
=
strstr
(
name
,
"://"
);
if
(
scheme
)
{
scheme
+=
3
;
name
=
scheme
;
}
/*
If they want to creat ?? should they know the type ???
What is the best course of action ??
*/
if
(
stat
(
name
,
&
st
)
==
-
1
)
if
(
stat
(
name
,
&
st
)
<
0
)
{
return
errno
;
/* errno set by stat () */
}
...
...
@@ -117,8 +124,7 @@ mailbox_mbox_init (mailbox_t *mbox, const char *name)
}
/* Why can't a mailbox be FIFO ? or a DOOR/Portal ? */
errno
=
EINVAL
;
return
-
1
;
return
EINVAL
;
}
void
...
...
mailbox/mbx_unix.c
View file @
3942950
...
...
@@ -226,12 +226,18 @@ mailbox_unix_init (mailbox_t *pmbox, const char *name)
mailbox_unix_data_t
mud
;
char
*
sep
;
/* sanity check */
if
(
name
==
NULL
||
*
name
==
'\0'
)
{
return
EINVAL
;
}
/* pass the url */
sep
=
strstr
(
name
,
"unix://"
);
if
(
sep
)
name
+=
7
;
/* allocate memory for mbox */
mbox
=
calloc
(
1
,
sizeof
(
*
mbox
));
if
(
mbox
==
NULL
)
...
...
Please
register
or
sign in
to post a comment