dhcp: add systemd's path-util.c for path_kill_slashes()

tempfn_xxxxxx() now uses path_kill_slashes(). Add path-util.c
from systemd source to provide it.
This commit is contained in:
Thomas Haller 2015-01-10 18:43:10 +01:00
parent 7d440b7006
commit 887a1ab397
4 changed files with 14 additions and 0 deletions

View file

@ -99,6 +99,8 @@ libsystemd_dhcp_la_SOURCES = \
dhcp-manager/systemd-dhcp/src/shared/log.h \
dhcp-manager/systemd-dhcp/src/shared/fileio.h \
dhcp-manager/systemd-dhcp/src/shared/fileio.c \
dhcp-manager/systemd-dhcp/src/shared/path-util.c \
dhcp-manager/systemd-dhcp/src/shared/path-util.h \
dhcp-manager/systemd-dhcp/src/shared/strv.h \
dhcp-manager/systemd-dhcp/src/shared/strv.c \
dhcp-manager/systemd-dhcp/src/shared/unaligned.h \

View file

@ -19,6 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "nm-sd-adapt.h"
#if 0 /* NM_IGNORED */
#include <string.h>
#include <unistd.h>
#include <errno.h>
@ -31,7 +34,9 @@
#include "util.h"
#include "log.h"
#include "strv.h"
#endif /* NM_IGNORED */
#include "path-util.h"
#if 0 /* NM_IGNORED */
#include "missing.h"
bool path_is_absolute(const char *p) {
@ -331,6 +336,7 @@ char **path_strv_resolve_uniq(char **l, const char *prefix) {
return strv_uniq(l);
}
#endif /* NM_IGNORED */
char *path_kill_slashes(char *path) {
char *f, *t;
@ -367,6 +373,7 @@ char *path_kill_slashes(char *path) {
return path;
}
#if 0 /* NM_IGNORED */
char* path_startswith(const char *path, const char *prefix) {
assert(path);
assert(prefix);
@ -684,3 +691,4 @@ int fsck_exists(const char *fstype) {
return 0;
}
#endif /* NM_IGNORED */

View file

@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "nm-sd-adapt.h"
#include <stdbool.h>
#include "macro.h"

View file

@ -85,7 +85,9 @@
#include "log.h"
#include "strv.h"
#include "mkdir.h"
#endif /* NM_IGNORED */
#include "path-util.h"
#if 0 /* NM_IGNORED */
#include "exit-status.h"
#include "hashmap.h"
#include "env-util.h"