ezmlmx
0.68
ezmlmx
Loading...
Searching...
No Matches
ezmlmx-0.68
src
lockfile.c
Go to the documentation of this file.
1
#include "lock.h"
2
#include "
errtxt.h
"
3
#include "
idx.h
"
4
#include "open.h"
5
#include "logmsg.h"
6
7
#define WHO "lockfile"
8
14
15
int
lockfile
(
const
char
*path)
16
{
17
int
fd
;
18
19
fd
= open_append(path);
20
if
(
fd
== -1)
21
logmsg
(
WHO
,111,FATAL,B(
ERR_OPEN
,path));
22
if
(lock_ex(
fd
) == -1)
23
logmsg
(
WHO
,111,FATAL,B(
ERR_OBTAIN
,path));
24
25
return
fd
;
26
}
idx.h
errtxt.h
Error messages. If you translate these, I would urge you to keep the English version as well....
ERR_OPEN
#define ERR_OPEN
Definition
errtxt.h:30
ERR_OBTAIN
#define ERR_OBTAIN
Definition
errtxt.h:31
WHO
#define WHO
Definition
author.c:1
fd
int fd
Definition
ezmlm-cgi.c:141
lockfile
int lockfile(const char *path)
Definition
lockfile.c:15
logmsg
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)
Definition
loginfo.c:32
Generated on
for ezmlmx by
1.14.0