summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2009-12-17 11:58:15 +0000
committerCarsten Haitzler <raster@rasterman.com>2009-12-17 11:58:15 +0000
commit5b9e0b0eada1db8ea0e3e90938ed3144d1abd8ee (patch)
treecd629e596a3cfd0d5fc4c70048d27b85469450f0 /legacy
parentc7c66a652a1f700df0780c36cfb321d79928f951 (diff)
fix return checks. broke compile!
SVN revision: 44523
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edje/src/bin/edje_cc_parse.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/legacy/edje/src/bin/edje_cc_parse.c b/legacy/edje/src/bin/edje_cc_parse.c
index 71d6f987b0..aa64dde668 100644
--- a/legacy/edje/src/bin/edje_cc_parse.c
+++ b/legacy/edje/src/bin/edje_cc_parse.c
@@ -34,6 +34,8 @@ void *alloca (size_t);
34#include <math.h> 34#include <math.h>
35 35
36#include "edje_cc.h" 36#include "edje_cc.h"
37#include <Ecore.h>
38#include <Ecore_File.h>
37 39
38static void new_object(void); 40static void new_object(void);
39static void new_statement(void); 41static void new_statement(void);
@@ -696,24 +698,28 @@ compile(void)
696 * Also, that preprocessor is not managing C++ comments, so pass the 698 * Also, that preprocessor is not managing C++ comments, so pass the
697 * sun cc preprocessor just after. 699 * sun cc preprocessor just after.
698 */ 700 */
699 snprintf(buf, sizeof(buf), "/usr/ccs/lib/cpp -I%s %s %s %s", 701 ret = -1;
700 inc, def, file_in, tmpn); 702 if (ecore_file_exists("/usr/ccs/lib/cpp"))
701 ret = system(buf); 703 {
702 if (ret == 0) 704 snprintf(buf, sizeof(buf), "/usr/ccs/lib/cpp -I%s %s %s %s",
703 { 705 inc, def, file_in, tmpn);
704 static char tmpn2[4096]; 706 ret = system(buf);
705 707 if (ret == 0)
706 snprintf (tmpn2, PATH_MAX, "%s/edje_cc.edc-tmp-XXXXXX", tmp_dir); 708 {
707 fd = mkstemp(tmpn2); 709 static char tmpn2[4096];
708 if (fd >= 0) 710
709 { 711 snprintf (tmpn2, PATH_MAX, "%s/edje_cc.edc-tmp-XXXXXX", tmp_dir);
710 close(fd); 712 fd = mkstemp(tmpn2);
711 snprintf (buf, 4096, "cc -E -I%s %s -o %s %s", 713 if (fd >= 0)
712 inc, def, tmpn2, tmpn); 714 {
713 ret = system(buf); 715 close(fd);
714 snprintf(tmpn, 4096, "%s", tmpn2); 716 snprintf (buf, 4096, "cc -E -I%s %s -o %s %s",
715 } 717 inc, def, tmpn2, tmpn);
716 } 718 ret = system(buf);
719 snprintf(tmpn, 4096, "%s", tmpn2);
720 }
721 }
722 }
717 /* 723 /*
718 * On some BSD based systems (MacOS, OpenBSD), the default cpp 724 * On some BSD based systems (MacOS, OpenBSD), the default cpp
719 * in the path is a wrapper script that chokes on the -o option. 725 * in the path is a wrapper script that chokes on the -o option.
@@ -728,13 +734,13 @@ compile(void)
728 * OpenSolaris: using gcc -E to remove them after using cpp. 734 * OpenSolaris: using gcc -E to remove them after using cpp.
729 * 735 *
730 */ 736 */
731 if (ret < 0) 737 if (ret != 0)
732 { 738 {
733 snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s", 739 snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s",
734 file_in, inc, def, tmpn); 740 file_in, inc, def, tmpn);
735 ret = system(buf); 741 ret = system(buf);
736 } 742 }
737 if (ret < 0) 743 if (ret != 0)
738 { 744 {
739 snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s", 745 snprintf(buf, sizeof(buf), "gcc -I%s %s -E -o %s %s",
740 inc, def, tmpn, file_in); 746 inc, def, tmpn, file_in);