summaryrefslogtreecommitdiff
path: root/legacy/eio/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-10-13 17:46:02 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-10-13 17:46:02 +0000
commitf3b720812eef9327b575b9716e54cfcb6325e9cb (patch)
tree15184953b2b2fe60a26e29c6006fa671a971165a /legacy/eio/src
parent25e84c7f3dd8d700778e8da126f04ee5d40ee5dc (diff)
* e, eio: fix ecore_thread_run breakage.
SVN revision: 53371
Diffstat (limited to 'legacy/eio/src')
-rw-r--r--legacy/eio/src/lib/eio_dir.c24
-rw-r--r--legacy/eio/src/lib/eio_file.c10
-rw-r--r--legacy/eio/src/lib/eio_private.h4
-rw-r--r--legacy/eio/src/lib/eio_single.c18
4 files changed, 34 insertions, 22 deletions
diff --git a/legacy/eio/src/lib/eio_dir.c b/legacy/eio/src/lib/eio_dir.c
index 6b4456ff93..2475861db1 100644
--- a/legacy/eio/src/lib/eio_dir.c
+++ b/legacy/eio/src/lib/eio_dir.c
@@ -38,7 +38,7 @@ _eio_dir_recursiv_ls(Ecore_Thread *thread, Eio_Dir_Copy *copy, const char *targe
38 it = eina_file_direct_ls(target); 38 it = eina_file_direct_ls(target);
39 if (!it) 39 if (!it)
40 { 40 {
41 eio_file_thread_error(&copy->progress.common); 41 eio_file_thread_error(&copy->progress.common, thread);
42 return EINA_FALSE; 42 return EINA_FALSE;
43 } 43 }
44 44
@@ -50,7 +50,7 @@ _eio_dir_recursiv_ls(Ecore_Thread *thread, Eio_Dir_Copy *copy, const char *targe
50 case DT_UNKNOWN: 50 case DT_UNKNOWN:
51 if (stat(info->path, &buffer) != 0) 51 if (stat(info->path, &buffer) != 0)
52 { 52 {
53 eio_file_thread_error(&copy->progress.common); 53 eio_file_thread_error(&copy->progress.common, thread);
54 goto on_error; 54 goto on_error;
55 } 55 }
56 56
@@ -135,10 +135,16 @@ _eio_dir_copy_heavy(Ecore_Thread *thread, void *data)
135 if (stat(copy->progress.dest, &buffer) != 0) 135 if (stat(copy->progress.dest, &buffer) != 0)
136 { 136 {
137 if (stat(copy->progress.source, &buffer) != 0) 137 if (stat(copy->progress.source, &buffer) != 0)
138 goto on_error; 138 {
139 eio_file_thread_error(&copy->progress.common, thread);
140 goto on_error;
141 }
139 142
140 if (mkdir(copy->progress.dest, buffer.st_mode) != 0) 143 if (mkdir(copy->progress.dest, buffer.st_mode) != 0)
141 goto on_error; 144 {
145 eio_file_thread_error(&copy->progress.common, thread);
146 goto on_error;
147 }
142 } 148 }
143 149
144 /* create all directory */ 150 /* create all directory */
@@ -153,11 +159,17 @@ _eio_dir_copy_heavy(Ecore_Thread *thread, void *data)
153 /* FIXME: in some case we already did a stat call, so would be nice to reuse previous result here */ 159 /* FIXME: in some case we already did a stat call, so would be nice to reuse previous result here */
154 /* FIXME: apply mode later so that readonly could be copied and property will be set correctly */ 160 /* FIXME: apply mode later so that readonly could be copied and property will be set correctly */
155 if (stat(dir, &buffer) != 0) 161 if (stat(dir, &buffer) != 0)
156 goto on_error; 162 {
163 eio_file_thread_error(&copy->progress.common, thread);
164 goto on_error;
165 }
157 166
158 /* create the directory */ 167 /* create the directory */
159 if (mkdir(target, buffer.st_mode) != 0) 168 if (mkdir(target, buffer.st_mode) != 0)
160 goto on_error; 169 {
170 eio_file_thread_error(&copy->progress.common, thread);
171 goto on_error;
172 }
161 173
162 step++; 174 step++;
163 eio_progress_send(thread, &copy->progress, step, count); 175 eio_progress_send(thread, &copy->progress, step, count);
diff --git a/legacy/eio/src/lib/eio_file.c b/legacy/eio/src/lib/eio_file.c
index 7d317b79fc..4344f529e4 100644
--- a/legacy/eio/src/lib/eio_file.c
+++ b/legacy/eio/src/lib/eio_file.c
@@ -31,7 +31,7 @@ _eio_file_heavy(Ecore_Thread *thread, void *data)
31 ls = eina_file_ls(async->ls.directory); 31 ls = eina_file_ls(async->ls.directory);
32 if (!ls) 32 if (!ls)
33 { 33 {
34 eio_file_thread_error(&async->ls.common); 34 eio_file_thread_error(&async->ls.common, thread);
35 return ; 35 return ;
36 } 36 }
37 37
@@ -75,7 +75,7 @@ _eio_file_direct_heavy(Ecore_Thread *thread, void *data)
75 ls = eina_file_direct_ls(async->ls.directory); 75 ls = eina_file_direct_ls(async->ls.directory);
76 if (!ls) 76 if (!ls)
77 { 77 {
78 eio_file_thread_error(&async->ls.common); 78 eio_file_thread_error(&async->ls.common, thread);
79 return ; 79 return ;
80 } 80 }
81 81
@@ -265,7 +265,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy)
265 in = open(copy->source, O_RDONLY); 265 in = open(copy->source, O_RDONLY);
266 if (in < 0) 266 if (in < 0)
267 { 267 {
268 eio_file_thread_error(&copy->common); 268 eio_file_thread_error(&copy->common, thread);
269 return EINA_FALSE; 269 return EINA_FALSE;
270 } 270 }
271 271
@@ -302,7 +302,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy)
302 return EINA_TRUE; 302 return EINA_TRUE;
303 303
304 on_error: 304 on_error:
305 eio_file_thread_error(&copy->common); 305 eio_file_thread_error(&copy->common, thread);
306 306
307 if (in >= 0) close(in); 307 if (in >= 0) close(in);
308 if (out >= 0) close(out); 308 if (out >= 0) close(out);
@@ -424,7 +424,7 @@ _eio_file_move_heavy(Ecore_Thread *thread, void *data)
424 Eio_File_Move *move = data; 424 Eio_File_Move *move = data;
425 425
426 if (rename(move->progress.source, move->progress.dest) < 0) 426 if (rename(move->progress.source, move->progress.dest) < 0)
427 eio_file_thread_error(&move->progress.common); 427 eio_file_thread_error(&move->progress.common, thread);
428 else 428 else
429 eio_progress_send(thread, &move->progress, 1, 1); 429 eio_progress_send(thread, &move->progress, 1, 1);
430} 430}
diff --git a/legacy/eio/src/lib/eio_private.h b/legacy/eio/src/lib/eio_private.h
index b8528e025c..d42fa9a67a 100644
--- a/legacy/eio/src/lib/eio_private.h
+++ b/legacy/eio/src/lib/eio_private.h
@@ -146,7 +146,7 @@ Eina_Bool eio_file_set(Eio_File *common,
146 Eio_Done_Cb done_cb, 146 Eio_Done_Cb done_cb,
147 Eio_Error_Cb error_cb, 147 Eio_Error_Cb error_cb,
148 const void *data, 148 const void *data,
149 Ecore_Cb job_cb, 149 Ecore_Thread_Heavy_Cb job_cb,
150 Ecore_Cb end_cb, 150 Ecore_Cb end_cb,
151 Ecore_Cb cancel_cb); 151 Ecore_Cb cancel_cb);
152 152
@@ -161,7 +161,7 @@ Eina_Bool eio_long_file_set(Eio_File *common,
161 Ecore_Cb cancel_cb); 161 Ecore_Cb cancel_cb);
162 162
163void eio_file_error(Eio_File *common); 163void eio_file_error(Eio_File *common);
164void eio_file_thread_error(Eio_File *common); 164void eio_file_thread_error(Eio_File *common, Ecore_Thread *thread);
165 165
166Eina_File_Direct_Info *eio_direct_info_malloc(void); 166Eina_File_Direct_Info *eio_direct_info_malloc(void);
167void eio_direct_info_free(Eina_File_Direct_Info *data); 167void eio_direct_info_free(Eina_File_Direct_Info *data);
diff --git a/legacy/eio/src/lib/eio_single.c b/legacy/eio/src/lib/eio_single.c
index 76fb97b129..04b468e883 100644
--- a/legacy/eio/src/lib/eio_single.c
+++ b/legacy/eio/src/lib/eio_single.c
@@ -29,10 +29,10 @@ eio_file_error(Eio_File *common)
29} 29}
30 30
31void 31void
32eio_file_thread_error(Eio_File *common) 32eio_file_thread_error(Eio_File *common, Ecore_Thread *thread)
33{ 33{
34 common->error = errno; 34 common->error = errno;
35 ecore_thread_cancel(common->thread); 35 ecore_thread_cancel(thread);
36} 36}
37 37
38Eina_Bool 38Eina_Bool
@@ -71,7 +71,7 @@ eio_file_set(Eio_File *common,
71 Eio_Done_Cb done_cb, 71 Eio_Done_Cb done_cb,
72 Eio_Error_Cb error_cb, 72 Eio_Error_Cb error_cb,
73 const void *data, 73 const void *data,
74 Ecore_Cb job_cb, 74 Ecore_Thread_Heavy_Cb job_cb,
75 Ecore_Cb end_cb, 75 Ecore_Cb end_cb,
76 Ecore_Cb cancel_cb) 76 Ecore_Cb cancel_cb)
77{ 77{
@@ -95,12 +95,12 @@ eio_file_set(Eio_File *common,
95/* --- */ 95/* --- */
96 96
97static void 97static void
98_eio_file_mkdir(void *data) 98_eio_file_mkdir(Ecore_Thread *thread, void *data)
99{ 99{
100 Eio_File_Mkdir *m = data; 100 Eio_File_Mkdir *m = data;
101 101
102 if (mkdir(m->path, m->mode) != 0) 102 if (mkdir(m->path, m->mode) != 0)
103 eio_file_thread_error(&m->common); 103 eio_file_thread_error(&m->common, thread);
104} 104}
105 105
106static void 106static void
@@ -131,12 +131,12 @@ _eio_file_mkdir_error(void *data)
131} 131}
132 132
133static void 133static void
134_eio_file_unlink(void *data) 134_eio_file_unlink(Ecore_Thread *thread, void *data)
135{ 135{
136 Eio_File_Unlink *l = data; 136 Eio_File_Unlink *l = data;
137 137
138 if (unlink(l->path) != 0) 138 if (unlink(l->path) != 0)
139 eio_file_thread_error(&l->common); 139 eio_file_thread_error(&l->common, thread);
140} 140}
141 141
142static void 142static void
@@ -167,12 +167,12 @@ _eio_file_unlink_error(void *data)
167} 167}
168 168
169static void 169static void
170_eio_file_stat(void *data) 170_eio_file_stat(Ecore_Thread *thread, void *data)
171{ 171{
172 Eio_File_Stat *s = data; 172 Eio_File_Stat *s = data;
173 173
174 if (stat(s->path, &s->buffer) != 0) 174 if (stat(s->path, &s->buffer) != 0)
175 eio_file_thread_error(&s->common); 175 eio_file_thread_error(&s->common, thread);
176} 176}
177 177
178static void 178static void