aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-02-28 23:27:47 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-02-28 23:27:47 +0000
commitdba2a95572a59711e1a1f95c2179db02923f6617 (patch)
tree75143c8bee4724ee6375333f4d8517f2f7ca01c8 /legacy/ecore/src/lib/ecore/ecore.c
parentremove stupid letter I introduced by mistake. (diff)
downloadefl-dba2a95572a59711e1a1f95c2179db02923f6617.tar.gz
warnings--
Ecore now goes clean on -Wall -Wextra :-) SVN revision: 46672
Diffstat (limited to 'legacy/ecore/src/lib/ecore/ecore.c')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore.c b/legacy/ecore/src/lib/ecore/ecore.c
index 60c6470fe9..45243bb019 100644
--- a/legacy/ecore/src/lib/ecore/ecore.c
+++ b/legacy/ecore/src/lib/ecore/ecore.c
@@ -11,6 +11,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
+#include <errno.h>
#ifdef HAVE_LOCALE_H
# include <locale.h>
@@ -261,8 +262,28 @@ _ecore_fps_debug_init(void)
if (_ecore_fps_debug_fd >= 0)
{
unsigned int zero = 0;
+ char *buf = (char *)&zero;
+ ssize_t todo = sizeof(unsigned int);
- write(_ecore_fps_debug_fd, &zero, sizeof(unsigned int));
+ while (todo > 0)
+ {
+ ssize_t r = write(_ecore_fps_debug_fd, buf, todo);
+ if (r > 0)
+ {
+ todo -= r;
+ buf += r;
+ }
+ else if ((r < 0) && (errno == EINTR))
+ continue;
+ else
+ {
+ ERR("could not write to file '%s' fd %d: %s",
+ tmp, _ecore_fps_debug_fd, strerror(errno));
+ close(_ecore_fps_debug_fd);
+ _ecore_fps_debug_fd = -1;
+ return;
+ }
+ }
_ecore_fps_runtime_mmap = mmap(NULL, sizeof(unsigned int),
PROT_READ | PROT_WRITE,
MAP_SHARED,