* [PATCH 1/2] nilfs-tune: add static/const specifiers where applicable
@ 2011-12-23 15:11 Dan McGee
[not found] ` <1324653076-13692-1-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Dan McGee @ 2011-12-23 15:11 UTC (permalink / raw)
To: linux-nilfs-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Dan McGee <dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
---
sbin/nilfs-tune/nilfs-tune.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/sbin/nilfs-tune/nilfs-tune.c b/sbin/nilfs-tune/nilfs-tune.c
index d5bc00f..cd5ef24 100644
--- a/sbin/nilfs-tune/nilfs-tune.c
+++ b/sbin/nilfs-tune/nilfs-tune.c
@@ -100,7 +100,7 @@ const static __u64 clear_ok_features[NILFS_MAX_FEATURE_TYPES] = {
0
};
-int parse_uuid(const char *uuid_string, __u8 *uuid)
+static int parse_uuid(const char *uuid_string, __u8 *uuid)
{
int i;
char p[3];
@@ -126,7 +126,8 @@ int parse_uuid(const char *uuid_string, __u8 *uuid)
return 0;
}
-void parse_options(int argc, char *argv[], struct nilfs_tune_options *opts)
+static void parse_options(int argc, char *argv[],
+ struct nilfs_tune_options *opts)
{
int c;
opts->flags = O_RDONLY;
@@ -274,7 +275,7 @@ static const char *group_string(gid_t gid)
return buf;
}
-static const char *uuid_string(unsigned char *uuid)
+static const char *uuid_string(const unsigned char *uuid)
{
static char buf[256];
@@ -349,7 +350,7 @@ static void print_features(FILE *f, struct nilfs_super_block *sbp)
fputs("\n", f);
}
-void show_nilfs_sb(struct nilfs_super_block *sbp)
+static void show_nilfs_sb(struct nilfs_super_block *sbp)
{
char label[sizeof(sbp->s_volume_name) + 1];
gid_t gid;
@@ -491,7 +492,7 @@ static int update_feature_set(struct nilfs_super_block *sbp,
return ret;
}
-int modify_nilfs(char *device, struct nilfs_tune_options *opts)
+static int modify_nilfs(const char *device, struct nilfs_tune_options *opts)
{
int devfd;
int ret = EXIT_SUCCESS;
@@ -563,7 +564,7 @@ out:
int main(int argc, char *argv[])
{
struct nilfs_tune_options opts;
- char *device;
+ const char *device;
printf("nilfs-tune %s\n", VERSION);
if (argc < 2) {
--
1.7.8.1
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] nilfs-tune: catch and handle missing device argument
[not found] ` <1324653076-13692-1-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
@ 2011-12-23 15:11 ` Dan McGee
0 siblings, 0 replies; 2+ messages in thread
From: Dan McGee @ 2011-12-23 15:11 UTC (permalink / raw)
To: linux-nilfs-u79uwXL29TY76Z2rM5mHXA
Before:
$ nilfs-tune -l
nilfs-tune 2.1.0
cannot open device -l: No such file or directory
After:
$ ./sbin/nilfs-tune/nilfs-tune -l
nilfs-tune 2.1.0
Usage: nilfs-tune [-h] [-l] [-i interval] [-L volume_name]
[-m block_max] [-O [^]feature[,...]]
[-U UUID] device
Signed-off-by: Dan McGee <dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
---
sbin/nilfs-tune/nilfs-tune.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/sbin/nilfs-tune/nilfs-tune.c b/sbin/nilfs-tune/nilfs-tune.c
index cd5ef24..6655029 100644
--- a/sbin/nilfs-tune/nilfs-tune.c
+++ b/sbin/nilfs-tune/nilfs-tune.c
@@ -187,6 +187,12 @@ static void parse_options(int argc, char *argv[],
exit(EXIT_FAILURE);
}
}
+
+ if (optind == argc)
+ {
+ nilfs_tune_usage();
+ exit(EXIT_FAILURE);
+ }
}
#define MINUTE (60)
--
1.7.8.1
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-23 15:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 15:11 [PATCH 1/2] nilfs-tune: add static/const specifiers where applicable Dan McGee
[not found] ` <1324653076-13692-1-git-send-email-dan-fd97jBR+K/6hPH1hqNUYSQ@public.gmane.org>
2011-12-23 15:11 ` [PATCH 2/2] nilfs-tune: catch and handle missing device argument Dan McGee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).