blob: fb44dc76ac56265080be46fa682261b83572d984 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/*******************************************************************/
/* slibtool: a skinny libtool implementation, written in C */
/* Copyright (C) 2016 Z. Gilboa */
/* Released under the Standard MIT License; see COPYING.SLIBTOOL. */
/*******************************************************************/
#include <slibtool/slibtool.h>
#include "slibtool_spawn_impl.h"
int slbt_copy_file(
const struct slbt_driver_ctx * dctx,
struct slbt_exec_ctx * ectx,
char * src,
char * dst)
{
char * cp[4];
/* cp argv */
cp[0] = "cp";
cp[1] = src;
cp[2] = dst;
cp[3] = 0;
/* alternate argument vector */
ectx->argv = cp;
ectx->program = "cp";
/* step output */
if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT))
if (slbt_output_link(dctx,ectx))
return -1;
/* dlltool spawn */
if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
return -1;
return 0;
}
|