raster pushed a commit to branch master.

commit 3dc555a7cfd6f93da123f07260d5755cbaa23b2e
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Mon Jul 15 11:45:19 2013 +0900

    fix warnings in build so new ones turn up and get fixed.
---
 src/bin/e_fm.c                   | 12 ++++++++----
 src/bin/e_fm/e_fm_main_udisks.c  |  7 ++++++-
 src/bin/e_fm/e_fm_main_udisks2.c |  7 ++++++-
 src/bin/e_fm_op.c                | 12 ++++++++----
 src/bin/e_static_grab.c          |  2 +-
 src/bin/e_thumb_main.c           |  4 +++-
 src/modules/clock/e_mod_main.c   |  7 ++++++-
 src/modules/fileman/e_fwin.c     | 14 +++++++-------
 8 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index 9194522..67bce15 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -9708,8 +9708,10 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool 
dir)
                   texts = ecore_thread_global_data_wait("efm_text_uri_list", 
0.01);
                   EINA_LIST_FOREACH(texts, l, path)
                     {
-                       write(fd, path, strlen(path));
-                       write(fd, "\n", 1);
+                       if (write(fd, path, strlen(path)) < 0)
+                         perror("write");
+                       if (write(fd, "\n", 1) < 0)
+                         perror("write");
                     }
                   close(fd);
                   ecore_thread_feedback(eth, strdup(buf));
@@ -9742,8 +9744,10 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool 
dir)
                        texts = 
ecore_thread_global_data_wait("efm_text_uri_list", 0.01);
                        EINA_LIST_FOREACH(texts, l, path)
                          {
-                            write(fd, path, strlen(path));
-                            write(fd, "\n", 1);
+                            if (write(fd, path, strlen(path)) < 0)
+                              perror("write");
+                            if (write(fd, "\n", 1) < 0)
+                              perror("write");
                          }
                        close(fd);
                        ecore_thread_feedback(eth, strdup(buf));
diff --git a/src/bin/e_fm/e_fm_main_udisks.c b/src/bin/e_fm/e_fm_main_udisks.c
index db3f8bb..96fd871 100644
--- a/src/bin/e_fm/e_fm_main_udisks.c
+++ b/src/bin/e_fm/e_fm_main_udisks.c
@@ -659,7 +659,7 @@ _e_fm_main_udisks_format_error_msg(char     **buf,
                                    const char *name,
                                    const char *message)
 {
-   int size, vu, vm, en;
+   int size, vu, vm = 1, en;
    char *tmp;
 
    vu = strlen(v->udi) + 1;
@@ -675,6 +675,11 @@ _e_fm_main_udisks_format_error_msg(char     **buf,
         strcpy(tmp, v->mount_point);
         tmp += vm;
      }
+   else
+     {
+        *tmp = 0;
+        tmp += vm;
+     }
    strcpy(tmp, name);
    tmp += en;
    strcpy(tmp, message);
diff --git a/src/bin/e_fm/e_fm_main_udisks2.c b/src/bin/e_fm/e_fm_main_udisks2.c
index c5686a2..900e579 100644
--- a/src/bin/e_fm/e_fm_main_udisks2.c
+++ b/src/bin/e_fm/e_fm_main_udisks2.c
@@ -738,7 +738,7 @@ _e_fm_main_udisks2_format_error_msg(char     **buf,
                                    const char *name,
                                    const char *message)
 {
-   int size, vu, vm, en;
+   int size, vu, vm = 1, en;
    char *tmp;
 
    vu = strlen(v->udi) + 1;
@@ -754,6 +754,11 @@ _e_fm_main_udisks2_format_error_msg(char     **buf,
         strcpy(tmp, v->mount_point);
         tmp += vm;
      }
+   else
+     {
+        *tmp = 0;
+        tmp += vm;
+     }
    strcpy(tmp, name);
    tmp += en;
    strcpy(tmp, message);
diff --git a/src/bin/e_fm_op.c b/src/bin/e_fm_op.c
index 1474b2f..85ad380 100644
--- a/src/bin/e_fm_op.c
+++ b/src/bin/e_fm_op.c
@@ -957,7 +957,8 @@ _e_fm_op_send_error(E_Fm_Op_Task *task, E_Fm_Op_Type type, 
const char *fmt, ...)
         *((int *)(buf + sizeof(int))) = type;
         *((int *)(buf + (2 * sizeof(int)))) = len + 1;
 
-        write(STDOUT_FILENO, buf, (3 * sizeof(int)) + len + 1);
+        if (write(STDOUT_FILENO, buf, (3 * sizeof(int)) + len + 1) < 0)
+          perror("write");
 
         E_FM_OP_DEBUG("%s", str);
         E_FM_OP_DEBUG(" Error sent.\n");
@@ -1036,7 +1037,8 @@ _e_fm_op_update_progress_report(int percent, int eta, 
double elapsed, off_t done
    P(dst);
 #undef P
 
-   write(STDOUT_FILENO, data, (3 * sizeof(int)) + size);
+   if (write(STDOUT_FILENO, data, (3 * sizeof(int)) + size) < 0)
+     perror("write");
 
    E_FM_OP_DEBUG("Time left: %d at %e\n", eta, elapsed);
    E_FM_OP_DEBUG("Progress %d. \n", percent);
@@ -1122,8 +1124,10 @@ _e_fm_op_copy_stat_info(E_Fm_Op_Task *task)
 
    if (!task->dst.name) return;
 
-   chmod(task->dst.name, task->src.st.st_mode);
-   chown(task->dst.name, task->src.st.st_uid, task->src.st.st_gid);
+   if (chmod(task->dst.name, task->src.st.st_mode) < 0)
+     perror("chmod");
+   if (chown(task->dst.name, task->src.st.st_uid, task->src.st.st_gid) < 0)
+     perror("chown");
    ut.actime = task->src.st.st_atime;
    ut.modtime = task->src.st.st_mtime;
    utime(task->dst.name, &ut);
diff --git a/src/bin/e_static_grab.c b/src/bin/e_static_grab.c
index bc34130..d1940fe 100644
--- a/src/bin/e_static_grab.c
+++ b/src/bin/e_static_grab.c
@@ -191,7 +191,7 @@ _e_static_grab_cpu(E_Static_Grab *grab)
         char *end;
         size_t length = 0;
 
-        fgets(buf, sizeof (buf), f);
+        if (!fgets(buf, sizeof (buf), f)) break;
         length = strlen(buf);
         end = buf + length;
 
diff --git a/src/bin/e_thumb_main.c b/src/bin/e_thumb_main.c
index dd26056..7f71559 100644
--- a/src/bin/e_thumb_main.c
+++ b/src/bin/e_thumb_main.c
@@ -88,7 +88,9 @@ main(int argc,
 
              val = argv[i] + 7;
              if (*val)
-               nice(atoi(val));
+               {
+                  if (nice(atoi(val)) < 0) perror("nice");
+               }
           }
      }
 
diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c
index c5e2fcd..5063b88 100644
--- a/src/modules/clock/e_mod_main.c
+++ b/src/modules/clock/e_mod_main.c
@@ -830,7 +830,12 @@ _clock_fd_update(void *d __UNUSED__, Ecore_Fd_Handler *fdh)
 {
    char buf[64];
 
-   read(ecore_main_fd_handler_fd_get(fdh), buf, sizeof(buf));
+   if (read(ecore_main_fd_handler_fd_get(fdh), buf, sizeof(buf)) < 0)
+     {
+        close(ecore_main_fd_handler_fd_get(fdh));
+        timerfd_handler = ecore_main_fd_handler_del(timerfd_handler);
+        return EINA_FALSE;
+     }
    e_int_clock_instances_redo(EINA_TRUE);
    return EINA_TRUE;
 }
diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c
index a6a922f..c823810 100644
--- a/src/modules/fileman/e_fwin.c
+++ b/src/modules/fileman/e_fwin.c
@@ -1271,7 +1271,7 @@ _e_fwin_desktop_run(Efreet_Desktop *desktop,
    if (!selected) return;
 
    if (!getcwd(pcwd, sizeof(pcwd))) return;
-   if (0 > chdir(e_fm2_real_path_get(page->fm_obj))) return;
+   if (chdir(e_fm2_real_path_get(page->fm_obj)) < 0) return;
 
    EINA_LIST_FOREACH(selected, l, ici)
      {
@@ -1311,7 +1311,7 @@ _e_fwin_desktop_run(Efreet_Desktop *desktop,
 
    EINA_LIST_FREE(files, file) free(file);
 
-   chdir(pcwd);
+   if (chdir(pcwd) < 0) perror("chdir");
 }
 
 static E_Fwin_Exec_Type
@@ -1989,9 +1989,9 @@ _e_fwin_cb_dir_handler(void *data __UNUSED__, Evas_Object 
*obj __UNUSED__, const
 
    if (!getcwd(buf, sizeof(buf))) return;
 
-   chdir(path);
+   if (chdir(path) < 0) perror("chdir");
    e_exec(e_util_zone_current_get(e_manager_current_get()), tdesktop, NULL, 
NULL, "fileman");
-   chdir(buf);
+   if (chdir(buf) < 0) perror("chdir");
    /* FIXME: if info != null then check mime type and offer options based
     * on that
     */
@@ -2461,8 +2461,8 @@ _e_fwin_file_open_dialog(E_Fwin_Page *page,
              if ((has_default) && (apps)) desk = apps->data;
              else if (mlist) desk = e_exehist_mime_desktop_get(mlist->data);
              //fprintf(stderr, "mlist = %p\n", mlist);
-             getcwd(pcwd, sizeof(pcwd));
-             chdir(e_fm2_real_path_get(page->fm_obj));
+             if (!getcwd(pcwd, sizeof(pcwd))) perror("getcwd");
+             if (chdir(e_fm2_real_path_get(page->fm_obj)) < 0) perror("chdir");
 
              files_list = NULL;
              EINA_LIST_FOREACH(files, l, ici)
@@ -2500,7 +2500,7 @@ _e_fwin_file_open_dialog(E_Fwin_Page *page,
              EINA_LIST_FREE(files_list, file)
                free(file);
 
-             chdir(pcwd);
+             if (chdir(pcwd) < 0) perror("chdir");
              if (!need_dia)
                {
                   EINA_LIST_FREE(apps, desk) efreet_desktop_free(desk);

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to