aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-03-18 14:11:41 +0100
committerFabian Groffen <grobian@gentoo.org>2019-03-18 14:13:19 +0100
commita221d981b4349b07d8b3869cb8ad2bb06d353a7a (patch)
tree1b3d480c25302c9d49d85884e292c10434421a99 /libq/xmkdir.c
parentq.c: move run_applet_l to its only consumer qmerge.c (diff)
downloadportage-utils-a221d981b4349b07d8b3869cb8ad2bb06d353a7a.tar.gz
portage-utils-a221d981b4349b07d8b3869cb8ad2bb06d353a7a.tar.bz2
portage-utils-a221d981b4349b07d8b3869cb8ad2bb06d353a7a.zip
libq: standardise build
Compile each C-file by itself, producing an object which is linked into a convenience archive. The q program then links against that archive. Switch to autotools-based build for everyone. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'libq/xmkdir.c')
-rw-r--r--libq/xmkdir.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/libq/xmkdir.c b/libq/xmkdir.c
index bc89fe08..e945227d 100644
--- a/libq/xmkdir.c
+++ b/libq/xmkdir.c
@@ -1,5 +1,17 @@
+/*
+ * Copyright 2011-2019 Gentoo Foundation
+ * Distributed under the terms of the GNU General Public License v2
+ *
+ * Copyright 2011-2016 Mike Frysinger - <vapier@gentoo.org>
+ * Copyright 2017- Fabian Groffen - <grobian@gentoo.org>
+ */
+
+#include "main.h"
+#include "xmalloc.h"
+#include "xmkdir.h"
+
/* Emulate `mkdir -p -m MODE PATH` */
-static int
+int
mkdir_p_at(int dfd, const char *path, mode_t mode)
{
char *_p, *p, *s;
@@ -36,14 +48,15 @@ mkdir_p_at(int dfd, const char *path, mode_t mode)
return 0;
}
-static int
+
+int
mkdir_p(const char *path, mode_t mode)
{
return mkdir_p_at(AT_FDCWD, path, mode);
}
/* Emulate `rm -rf PATH` */
-static int
+int
rm_rf_at(int dfd, const char *path)
{
int subdfd;
@@ -86,13 +99,13 @@ rm_rf_at(int dfd, const char *path)
return ret;
}
-static int
+int
rm_rf(const char *path)
{
return rm_rf_at(AT_FDCWD, path);
}
-static int
+int
rmdir_r_at(int dfd, const char *path)
{
size_t len;
@@ -114,10 +127,8 @@ rmdir_r_at(int dfd, const char *path)
return 0;
}
-/*
-static int
+int
rmdir_r(const char *path)
{
return rmdir_r_at(AT_FDCWD, path);
}
-*/