projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop mixmaster support. I don't like people caring about being anonymous that much.
[apps/madmutt.git]
/
dotlock.c
diff --git
a/dotlock.c
b/dotlock.c
index
e196464
..
94f569f
100644
(file)
--- a/
dotlock.c
+++ b/
dotlock.c
@@
-8,30
+8,10
@@
* please see the file GPL in the top level source directory.
*/
* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <lib-lib/lib-lib.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <sys/file.h>
-#include <sys/stat.h>
#include <sys/utsname.h>
#include <sys/utsname.h>
-#include <errno.h>
-#include <time.h>
-#include <fcntl.h>
-#include <limits.h>
-
-#ifndef _POSIX_PATH_MAX
-#include <posix1_lim.h>
-#endif
-
#include "dotlock.h"
#include "dotlock.h"
-#include "config.h"
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
@@
-55,12
+35,6
@@
# endif
# endif
-# ifndef HAVE_SNPRINTF
-extern int snprintf (char *, size_t, const char *, ...);
-# endif
-
-#include <lib-lib/str.h>
-
static int DotlockFlags;
static int Retry = MAXLOCKATTEMPT;
static int DotlockFlags;
static int Retry = MAXLOCKATTEMPT;
@@
-94,7
+68,9
@@
static int dotlock_unlink (const char *);
static int dotlock_lock (const char *);
static int dotlock_lock (const char *);
-#define check_flags(a) if (a & DL_FL_ACTIONS) usage (argv[0])
+#define check_flags(a) \
+ if (a & (DL_FL_TRY|DL_FL_UNLOCK|DL_FL_UNLINK)) \
+ usage(argv[0])
int main (int argc, char **argv)
{
int main (int argc, char **argv)
{
@@
-111,7
+87,7
@@
int main (int argc, char **argv)
/* determine the system's host name */
uname (&utsname);
/* determine the system's host name */
uname (&utsname);
- if (!(Hostname = strdup
(utsname.nodename))) /* __MEM_CHECKED__ */
+ if (!(Hostname = strdup
(utsname.nodename)))
return DL_EX_ERROR;
if ((p = strchr (Hostname, '.')))
*p = '\0';
return DL_EX_ERROR;
if ((p = strchr (Hostname, '.')))
*p = '\0';
@@
-446,11
+422,9
@@
dotlock_expand_link (char *newpath, const char *path, const char *flink)
/*
* Deference a chain of symbolic links
/*
* Deference a chain of symbolic links
- *
- * The final path is written to d.
*
*
+ * The final path is written to d.
*/
*/
-
static int dotlock_deference_symlink (char *d, size_t l, const char *path)
{
struct stat sb;
static int dotlock_deference_symlink (char *d, size_t l, const char *path)
{
struct stat sb;
@@
-502,7
+476,7
@@
static int dotlock_lock (const char *frealpath)
{
char lockfile[_POSIX_PATH_MAX + LONG_STRING];
char nfslockfile[_POSIX_PATH_MAX + LONG_STRING];
{
char lockfile[_POSIX_PATH_MAX + LONG_STRING];
char nfslockfile[_POSIX_PATH_MAX + LONG_STRING];
- size_t prev_size = 0;
+ s
s
ize_t prev_size = 0;
int fd;
int count = 0;
int hard_count = 0;
int fd;
int count = 0;
int hard_count = 0;