projects
/
services
/
createrepo_c.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49b1582
)
Add check if input directory exist
author
Tomas Mlcoch
<tmlcoch@redhat.com>
Mon, 28 May 2012 07:47:29 +0000
(09:47 +0200)
committer
Tomas Mlcoch
<tmlcoch@redhat.com>
Mon, 28 May 2012 07:47:29 +0000
(09:47 +0200)
src/createrepo_c.c
patch
|
blob
|
history
diff --git
a/src/createrepo_c.c
b/src/createrepo_c.c
index
1ebbc86
..
badf59b
100644
(file)
--- a/
src/createrepo_c.c
+++ b/
src/createrepo_c.c
@@
-264,6
+264,16
@@
int main(int argc, char **argv) {
cmd_options->input_dir = g_strdup(in_dir);
+ // Check if inputdir exists
+
+ if (!g_file_test(cmd_options->input_dir, G_FILE_TEST_EXISTS|G_FILE_TEST_IS_DIR)) {
+ g_warning("Directory %s must exist", cmd_options->input_dir);
+ g_free(in_dir);
+ free_options(cmd_options);
+ exit(1);
+ }
+
+
// Check parsed arguments
if (!check_arguments(cmd_options)) {