summaryrefslogtreecommitdiff
path: root/src/bin/eldbus/utils.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-07-17 12:57:19 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-07-18 11:34:18 -0400
commitc5155d2fccc020958c9a2d129076aec51f536d7f (patch)
tree77d79306c27bb56b0267f3950154b49e803f6968 /src/bin/eldbus/utils.c
parentf1bcd804eccef1778873598d073d8fb2e550f275 (diff)
eldbus: support output dir in codegen
@feature
Diffstat (limited to 'src/bin/eldbus/utils.c')
-rw-r--r--src/bin/eldbus/utils.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bin/eldbus/utils.c b/src/bin/eldbus/utils.c
index 514c209069..aaad290609 100644
--- a/src/bin/eldbus/utils.c
+++ b/src/bin/eldbus/utils.c
@@ -34,8 +34,16 @@ Eina_Bool
34file_write(const char *file_name, const char *buffer) 34file_write(const char *file_name, const char *buffer)
35{ 35{
36 FILE *file_handler; 36 FILE *file_handler;
37 const char *filename = file_name;
38 Eina_Strbuf *fname = NULL;
37 39
38 file_handler = fopen(file_name, "wt"); 40 if (output_dir)
41 {
42 fname = eina_strbuf_new();
43 eina_strbuf_append_printf(fname, "%s/%s", output_dir, file_name);
44 filename = eina_strbuf_string_get(fname);
45 }
46 file_handler = fopen(filename, "wt");
39 if (!file_handler) 47 if (!file_handler)
40 { 48 {
41 printf("Error to write file: %s\n", file_name); 49 printf("Error to write file: %s\n", file_name);
@@ -47,6 +55,7 @@ file_write(const char *file_name, const char *buffer)
47 printf("Error writing to file: %s\n", file_name); 55 printf("Error writing to file: %s\n", file_name);
48 } 56 }
49 fclose(file_handler); 57 fclose(file_handler);
58 eina_strbuf_free(fname);
50 59
51 return EINA_TRUE; 60 return EINA_TRUE;
52} 61}