summaryrefslogtreecommitdiff
path: root/src/libposixplz/mklinktemp.c
blob: d1bee4bd27dd6610fc6fdcb15996fda3fbc33573 (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_t *la = data ;
  (void)mode ;
  return (*la->lf)(la->src, dst) ;
}

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