[sheepdog] [PATCH 1/2] sheepfs: check 'dog' command at startup
Liu Yuan
namei.unix at gmail.com
Thu Aug 15 09:34:06 CEST 2013
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
sheepfs/core.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/sheepfs/core.c b/sheepfs/core.c
index 02d5830..fecfb98 100644
--- a/sheepfs/core.c
+++ b/sheepfs/core.c
@@ -311,11 +311,10 @@ Options:\n\
int main(int argc, char **argv)
{
- struct strbuf path = STRBUF_INIT;
+ struct strbuf path = STRBUF_INIT, *t;
int ch, longindex;
char *dir = NULL, *cwd;
-
while ((ch = getopt_long(argc, argv, short_options, long_options,
&longindex)) >= 0) {
switch (ch) {
@@ -351,6 +350,13 @@ int main(int argc, char **argv)
}
}
+ t = sheepfs_run_cmd("dog");
+ if (!strlen(t->buf)) {
+ fprintf(stderr, "command dog not found\n");
+ exit(1);
+ }
+ strbuf_release(t);
+
if (optind != argc)
dir = argv[optind];
else
--
1.7.9.5
More information about the sheepdog
mailing list