mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 08/14] move make_directory declaration to libfile.h
Date: Tue, 19 Apr 2016 09:36:46 +0200	[thread overview]
Message-ID: <1461051412-25711-9-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1461051412-25711-1-git-send-email-s.hauer@pengutronix.de>

As a utility function for file handling make_directory() is well
suited for libfile. Move it there.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/automount.c | 1 +
 commands/mkdir.c     | 1 +
 fs/efi.c             | 1 +
 fs/fs.c              | 1 +
 include/fs.h         | 3 ---
 include/libfile.h    | 3 +++
 lib/make_directory.c | 1 +
 7 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/commands/automount.c b/commands/automount.c
index b491d20..a71430c 100644
--- a/commands/automount.c
+++ b/commands/automount.c
@@ -20,6 +20,7 @@
 #include <fs.h>
 #include <errno.h>
 #include <getopt.h>
+#include <libfile.h>
 
 static int do_automount(int argc, char *argv[])
 {
diff --git a/commands/mkdir.c b/commands/mkdir.c
index 1f97886..7d024c8 100644
--- a/commands/mkdir.c
+++ b/commands/mkdir.c
@@ -22,6 +22,7 @@
 #include <fs.h>
 #include <errno.h>
 #include <getopt.h>
+#include <libfile.h>
 
 static int do_mkdir(int argc, char *argv[])
 {
diff --git a/fs/efi.c b/fs/efi.c
index 5ae796b..26f2f66 100644
--- a/fs/efi.c
+++ b/fs/efi.c
@@ -30,6 +30,7 @@
 #include <fcntl.h>
 #include <wchar.h>
 #include <efi.h>
+#include <libfile.h>
 #include <mach/efi.h>
 #include <mach/efi-device.h>
 
diff --git a/fs/fs.c b/fs/fs.c
index ad8d99b..1711a0c 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -34,6 +34,7 @@
 #include <environment.h>
 #include <libgen.h>
 #include <block.h>
+#include <libfile.h>
 
 char *mkmodestr(unsigned long mode, char *str)
 {
diff --git a/include/fs.h b/include/fs.h
index b9d1e6e..21490db 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -126,9 +126,6 @@ ssize_t pwrite(int fd, const void *buf, size_t count, loff_t offset);
 
 loff_t lseek(int fildes, loff_t offset, int whence);
 int mkdir (const char *pathname, mode_t mode);
-
-/* Create a directory and its parents */
-int make_directory(const char *pathname);
 int rmdir (const char *pathname);
 
 const char *getcwd(void);
diff --git a/include/libfile.h b/include/libfile.h
index 51fa060..3f81718 100644
--- a/include/libfile.h
+++ b/include/libfile.h
@@ -21,4 +21,7 @@ int compare_file(const char *f1, const char *f2);
 
 int open_and_lseek(const char *filename, int mode, loff_t pos);
 
+/* Create a directory and its parents */
+int make_directory(const char *pathname);
+
 #endif /* __LIBFILE_H */
diff --git a/lib/make_directory.c b/lib/make_directory.c
index 7432efc..29d08cf 100644
--- a/lib/make_directory.c
+++ b/lib/make_directory.c
@@ -3,6 +3,7 @@
 #include <errno.h>
 #ifdef __BAREBOX__
 #include <fs.h>
+#include <libfile.h>
 #include <malloc.h>
 #include <common.h>
 #define STATIC
-- 
2.7.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-04-19  7:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19  7:36 include/prototype cleanup Sascha Hauer
2016-04-19  7:36 ` [PATCH 01/14] include: move run_command prototype to command.h Sascha Hauer
2016-04-19  7:36 ` [PATCH 02/14] include/common.h: remove unused struct memarea_info Sascha Hauer
2016-04-19  7:36 ` [PATCH 03/14] include: move shell prototypes to shell.h Sascha Hauer
2016-04-19  7:36 ` [PATCH 04/14] include: move crc specific stuff to crc.h Sascha Hauer
2016-04-19  7:36 ` [PATCH 05/14] libfile: move open_and_lseek() to libfile Sascha Hauer
2016-04-19  7:36 ` [PATCH 06/14] show_progress: print spaces with %*s Sascha Hauer
2016-04-19  7:36 ` [PATCH 07/14] string: Fix (v)asprintf prototypes Sascha Hauer
2016-04-19  7:36 ` Sascha Hauer [this message]
2016-04-19  7:36 ` [PATCH 09/14] move unlink_recursive declaration to libfile.h Sascha Hauer
2016-04-19  7:36 ` [PATCH 10/14] fs: move libc function prototypes to their correct locations Sascha Hauer
2016-04-19  7:36 ` [PATCH 11/14] stdio: rename getc to getchar Sascha Hauer
2016-04-19  7:36 ` [PATCH 12/14] stdio: replace fprintf(stderr,...) with eprintf Sascha Hauer
2016-04-19  7:36 ` [PATCH 13/14] stdio: Replace FILE functions with filedescriptor functions Sascha Hauer
2016-04-19  7:36 ` [PATCH 14/14] stdio: Whitespace cleanup Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461051412-25711-9-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox