ezmlmx 0.68
ezmlmx
Loading...
Searching...
No Matches
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
15int 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}
Error messages. If you translate these, I would urge you to keep the English version as well....
#define ERR_OPEN
Definition errtxt.h:30
#define ERR_OBTAIN
Definition errtxt.h:31
#define WHO
Definition author.c:1
int fd
Definition ezmlm-cgi.c:141
int lockfile(const char *path)
Definition lockfile.c:15
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)
Definition loginfo.c:32