* Check the returned value of eet_init() in the binary.
authorcaro <caro>
Fri, 2 Oct 2009 04:06:58 +0000 (04:06 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 2 Oct 2009 04:06:58 +0000 (04:06 +0000)
 * Use binary mode of fopen() in eet_main() for Windows compatibility

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eet@42851 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/bin/eet_main.c

index 4ca946f..0bcd9fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2009-10-01  Mathieu Taillefumier
 
        * remove useless Eina_Log macros.
+
+2009-10-01  Vincent Torri
+
+       * Check the returned value of eet_init() in the binary.
+       * Use binary mode of fopen() in eet_main() for Windows compatibility
index 43fac6f..0889008 100644 (file)
@@ -90,7 +90,7 @@ do_eet_extract(const char *file, const char *key, const char *out, const char *c
        ERR("cannot read key %s\n", key);
        exit(-1);
      }
-   f = fopen(out, "w");
+   f = fopen(out, "wb");
    if (!f)
      {
        ERR("cannot open %s\n", out);
@@ -124,7 +124,7 @@ do_eet_decode(const char *file, const char *key, const char *out, const char *cr
        ERR("cannot open for reading: %s\n", file);
        exit(-1);
      }
-   f = fopen(out, "w");
+   f = fopen(out, "wb");
    if (!f)
      {
        ERR("cannot open %s\n", out);
@@ -155,7 +155,7 @@ do_eet_insert(const char *file, const char *key, const char *out, int compress,
        ERR("cannot open for read+write: %s\n", file);
        exit(-1);
      }
-   f = fopen(out, "r");
+   f = fopen(out, "rb");
    if (!f)
      {
        ERR("cannot open %s\n", out);
@@ -198,7 +198,7 @@ do_eet_encode(const char *file, const char *key, const char *out, int compress,
        ERR("cannot open for read+write: %s\n", file);
        exit(-1);
      }
-   f = fopen(out, "r");
+   f = fopen(out, "rb");
    if (!f)
      {
        ERR("cannot open %s\n", out);
@@ -300,7 +300,9 @@ do_eet_sign(const char *file, const char *private_key, const char *public_key)
 int
 main(int argc, char **argv)
 {
-   eet_init();
+   if (!eet_init())
+     return -1;
+
    _eet_main_log_dom = eina_log_domain_register("Eet_Main",EINA_COLOR_CYAN);
    if(_eet_main_log_dom < -1)
      {