1/*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include "PackageSymlink.h"
8
9#include <stdlib.h>
10#include <string.h>
11
12
13PackageSymlink::PackageSymlink(Package* package, mode_t mode)
14	:
15	PackageLeafNode(package, mode),
16	fSymlinkPath(NULL)
17{
18}
19
20
21PackageSymlink::~PackageSymlink()
22{
23	free(fSymlinkPath);
24}
25
26
27status_t
28PackageSymlink::SetSymlinkPath(const char* path)
29{
30	if (path == NULL)
31		return B_OK;
32
33	fSymlinkPath = strdup(path);
34	return fSymlinkPath != NULL ? B_OK : B_NO_MEMORY;
35}
36
37
38const char*
39PackageSymlink::SymlinkPath() const
40{
41	return fSymlinkPath;
42}
43