]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
send_digest: prefer openat
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 3 Nov 2021 08:11:10 +0000 (09:11 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 3 Nov 2021 13:10:28 +0000 (14:10 +0100)
src/send_digest.c

index 833ee2819606b157539650cdfdd0f02ee0434f83..5567d2246c7a5db11cbd873e38d2a253f87ccdf2 100644 (file)
@@ -255,9 +255,9 @@ int send_digest(struct mlmmj_list *list, int firstindex, int lastindex,
        do {
                tmp = random_str();
                myfree(queuename);
-               queuename = concatstr(3, list->dir, "/queue/", tmp);
+               myasprintf(&queuename, "queue/%s", tmp);
                myfree(tmp);
-               fd = open(queuename, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR);
+               fd = openat(list->fd, queuename, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR);
        } while ((fd < 0) && (errno == EEXIST));
 
        if (fd < 0) {