Argument: the name of the lock file
-Copyright (c) The Exim Maintainers 2016
+Copyright (c) The Exim Maintainers 2016 - 2021
+SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "os.h"
static void
sigalrm_handler(int sig)
{
-sig = sig; /* Keep picky compilers happy */
sigalrm_seen = TRUE;
}
printf("usage: exim_lock [-v] [-q] [-lockfile] [-fcntl] [-flock] [-mbx]\n"
" [-retries <n>] [-interval <n>] [-timeout <n>] [-restore-times]\n"
" <file name> [command]\n");
-exit(1);
+exit(EXIT_FAILURE);
}
{
printf("exim_lock: can't use flock() because it was not available in the\n"
" operating system when exim_lock was compiled\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
#endif
if (pw == NULL)
{
printf("exim_lock: unable to expand file name %s\n", argv[i-1]);
- exit(1);
+ exit(EXIT_FAILURE);
}
if ((int)strlen(pw->pw_dir) + (int)strlen(filename) + 1 > sizeof(buffer))
{
printf("exim_lock: expanded file name %s%s is too long", pw->pw_dir,
filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
strcpy(buffer, pw->pw_dir);
if (uname(&s) < 0)
{
printf("exim_lock: failed to find host name using uname()\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
primary_hostname = s.nodename;
{
printf("exim_lock: failed to create hitching post %s: %s\n", hitchname,
strerror(errno));
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Apply hitching post algorithm. */
if (restore_times)
{
struct stat strestore;
-#ifdef EXIM_HAVE_OPENAT
+#ifdef EXIM_HAVE_FUTIMENS
int fd = open(filename, O_RDWR); /* use fd for both get & restore */
struct timespec tt[2];