exit(EXIT_FAILURE);
}
- subfilefd = open(subfilename, O_RDWR|O_CREAT,
+ subfilefd = open(subfilename, O_RDWR|O_CREAT|O_APPEND,
S_IRUSR|S_IWUSR|groupwritable);
if(subfilefd == -1) {
log_error(LOG_ARGS, "Could not open '%s'", subfilename);
exit(EXIT_FAILURE);
}
- lseek(subfilefd, 0L, SEEK_END);
len = strlen(address);
address[len] = '\n';
writen(subfilefd, address, len + 1);
/* DEPRECATED */
/* Add lists manually if they weren't encountered in the list text */
if (!normalsls->used && !digestsls->used && !nomailsls->used) {
- fd = open(queuefilename, O_WRONLY);
+ fd = open(queuefilename, O_WRONLY|O_APPEND);
if(fd < 0) {
log_error(LOG_ARGS, "Could not open sub list mail");
exit(EXIT_FAILURE);
}
- if(lseek(fd, 0, SEEK_END) < 0) {
- log_error(LOG_ARGS, "Could not seek to end of file");
- exit(EXIT_FAILURE);
- }
print_subs(fd, normalsls);
writen(fd, "\n-- \n", 5);
print_subs(fd, nomailsls);