/* Open the file for writing. */
- fd = open(filename, O_RDWR + O_APPEND);
- if (fd < 0)
+ if ((fd = open(filename, O_RDWR + O_APPEND)) < 0)
{
printf("exim_lock: failed to open %s for writing: %s\n", filename,
strerror(errno));
a timeout changes it to blocking. */
if (!use_mbx && (use_fcntl || use_flock))
- {
if (apply_lock(fd, F_WRLCK, use_fcntl, lock_fcntl_timeout, use_flock,
lock_flock_timeout) >= 0)
{
}
break;
}
- else goto RETRY; /* Message already output */
- }
+ else
+ goto RETRY; /* Message already output */
/* Lock using MBX rules. This is complicated and is documented with the
source of the c-client library that goes with Pine and IMAP. What has to
if (restore_times)
{
struct stat strestore;
+#ifdef EXIM_HAVE_OPENAT
+ int fd = open(filename, O_RDWR); /* use fd for both get & restore */
+ struct timespec tt[2];
+
+ fstat(fd, &strestore);
+ i = system(command);
+ tt[0] = strestore.st_atim;
+ tt[1] = strestore.st_mtim;
+ futimens(fd, tt);
+ close(fd);
+#else
struct utimbuf ut;
+
stat(filename, &strestore);
i = system(command);
ut.actime = strestore.st_atime;
ut.modtime = strestore.st_mtime;
utime(filename, &ut);
+#endif
}
else i = system(command);
static int parse_mailto_uri(struct Sieve *filter, const uschar *uri, string_item **recipient, struct String *header, struct String *subject, struct String *body)
{
const uschar *start;
-struct String to,hname,hvalue;
+struct String to, hname;
+struct String hvalue = {NULL, 0};
int capacity;
string_item *new;
filter->errmsg=US "Unknown URI scheme";
return 0;
}
+
uri+=7;
if (*uri && *uri!='?')
for (;;)