#endif /* DL_STANDALONE */
static int DotlockFlags;
-static int Retry = MAXLOCKATTEMPT;
+static int Retry = MAXLOCKATTEMPT;
#ifdef DL_STANDALONE
static char *Hostname;
#ifdef DL_STANDALONE
-#define check_flags (a) if (a & DL_FL_ACTIONS) usage (argv[0])
+#define check_flags(a) if (a & DL_FL_ACTIONS) usage (argv[0])
int main (int argc, char **argv)
{
/* parse the command line options. */
-
DotlockFlags = 0;
while ((i = getopt (argc, argv, "dtfupr:")) != EOF)
if (optind == argc || Retry < 0)
usage (argv[0]);
-
+
return dotlock_dispatch (argv[optind]);
- }
+}
/*
if ((currdir = open (".", O_RDONLY)) == -1)
return DL_EX_ERROR;
-
+
if (!(DotlockFlags & DL_FL_RETRY) || retry)
Retry = MAXLOCKATTEMPT;
else
return r;
}
-
+
#endif /* DL_STANDALONE */
-
-
+
static int dotlock_dispatch (const char *f)
{
unlink (realpath);
bail:
-
+
if (fd != -1) close (fd);
dotlock_unlock (realpath);