summaryrefslogtreecommitdiff
path: root/src/libposixplz/mklinktemp.c
blob: a96ab45176a79c0c475f1acc6b6fc82c0848cfe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ISC license. */

#include <unistd.h>

#include <skalibs/djbunix.h>
#include <skalibs/posixplz.h>

#include "posixplz-internal.h"

static int f (char const *dst, mode_t mode, void *data)
{
  linkarg *la = data ;
  (void)mode ;
  return (*la->lf)(la->src, dst) ;
}

int mklinktemp (char const *src, char *dst, link_func_ref lf)
{
  linkarg la = { .lf = lf, .src = src } ;
  return mkfiletemp(dst, &f, 0600, &la) ;
}