summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-04-06 20:55:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-04-06 20:55:10 +0200
commiteec2e9b2433983c775a692295a3c06799a9811d4 (patch)
tree2042b2fbd5a6b4a3230d5f5db3575d3822309228 /commands
parentd37201edc188364e9bb1d2e747de6c7fe1af8aaf (diff)
parent46e7bfbac6fa7d674e0536e012a2cb6af16abd34 (diff)
downloadbarebox-eec2e9b2433983c775a692295a3c06799a9811d4.tar.gz
barebox-eec2e9b2433983c775a692295a3c06799a9811d4.tar.xz
Merge branch 'for-next/fs'
Diffstat (limited to 'commands')
-rw-r--r--commands/loadenv.c6
-rw-r--r--commands/ls.c9
-rw-r--r--commands/mem.c2
-rw-r--r--commands/stddev.c8
4 files changed, 9 insertions, 16 deletions
diff --git a/commands/loadenv.c b/commands/loadenv.c
index 44e96c3b60..6469affadb 100644
--- a/commands/loadenv.c
+++ b/commands/loadenv.c
@@ -62,20 +62,16 @@ static int do_loadenv(int argc, char *argv[])
if (argc - optind < 1) {
filename = default_environment_path_get();
} else {
- char *str = normalise_path(argv[optind]);
-
/*
* /dev/defaultenv use to contain the defaultenvironment.
* we do not have this file anymore, but maintain compatibility
* to the 'loadenv -s /dev/defaultenv' command to restore the
* default environment for some time.
*/
- if (!strcmp(str, "/dev/defaultenv"))
+ if (!strcmp(argv[optind], "/dev/defaultenv"))
defaultenv = 1;
else
filename = argv[optind];
-
- free(str);
}
if (scrub) {
diff --git a/commands/ls.c b/commands/ls.c
index 771477b6e0..e54991862d 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -115,11 +115,8 @@ int ls(const char *path, ulong flags)
continue;
}
- if (s.st_mode & S_IFDIR) {
- char *norm = normalise_path(tmp);
- ls(norm, flags);
- free(norm);
- }
+ if (s.st_mode & S_IFDIR)
+ ls(tmp, flags);
}
out:
@@ -158,7 +155,7 @@ static int do_ls(int argc, char *argv[])
flags |= LS_SHOWARG;
if (optind == argc) {
- ret = ls(getcwd(), flags);
+ ret = ls(".", flags);
return ret ? 1 : 0;
}
diff --git a/commands/mem.c b/commands/mem.c
index 29eaa80b23..eb91ade05a 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -81,7 +81,7 @@ int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
return 0;
}
-static struct file_operations memops = {
+static struct cdev_operations memops = {
.read = mem_read,
.write = mem_write,
.memmap = generic_memmap_rw,
diff --git a/commands/stddev.c b/commands/stddev.c
index 93da2c7398..4d1b6f5108 100644
--- a/commands/stddev.c
+++ b/commands/stddev.c
@@ -25,7 +25,7 @@ static ssize_t zero_read(struct cdev *cdev, void *buf, size_t count, loff_t offs
return count;
}
-static struct file_operations zeroops = {
+static struct cdev_operations zeroops = {
.read = zero_read,
.lseek = dev_lseek_default,
};
@@ -53,7 +53,7 @@ static ssize_t full_read(struct cdev *cdev, void *buf, size_t count, loff_t offs
return count;
}
-static struct file_operations fullops = {
+static struct cdev_operations fullops = {
.read = full_read,
.lseek = dev_lseek_default,
};
@@ -80,7 +80,7 @@ static ssize_t null_write(struct cdev *cdev, const void *buf, size_t count, loff
return count;
}
-static struct file_operations nullops = {
+static struct cdev_operations nullops = {
.write = null_write,
.lseek = dev_lseek_default,
};
@@ -108,7 +108,7 @@ static ssize_t prng_read(struct cdev *cdev, void *buf, size_t count, loff_t offs
return count;
}
-static struct file_operations prngops = {
+static struct cdev_operations prngops = {
.read = prng_read,
.lseek = dev_lseek_default,
};