leafnode  1.12.0
About: Leafnode is a store & forward NNTP proxy for small (dialup) sites.
  Fossies Dox: leafnode-1.12.0.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

log_unlink.c
Go to the documentation of this file.
1/* (C) 2001 - 2010 by Matthias Andree */
2
3#include "leafnode.h"
4#include <unistd.h>
5
6#ifdef WITH_DMALLOC
7#include <dmalloc.h>
8#endif
9
10#include "ln_log.h"
11
12int
13log_unlink(const char *f, int ignore_enoent)
14{
15 int r = unlink(f);
16 if (r < 0 && errno == ENOENT && ignore_enoent)
17 r = 0;
18 if (r < 0)
19 ln_log(LNLOG_SERR, LNLOG_CTOP, "cannot unlink %s: %m", f);
20 else {
21 if (debugmode)
22 ln_log(LNLOG_SDEBUG, LNLOG_CTOP, "unlinked %s", f);
23 }
24 return r;
25}
int debugmode
Definition: configutil.c:67
void ln_log(int sev, int ctx, const char *format,...)
Definition: ln_log.c:103
#define LNLOG_SERR
Definition: ln_log.h:13
#define LNLOG_CTOP
Definition: ln_log.h:22
#define LNLOG_SDEBUG
Definition: ln_log.h:17