ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.154 by root, Wed Nov 28 11:53:37 2007 UTC vs.
Revision 1.156 by root, Wed Nov 28 17:50:13 2007 UTC

281 perror (msg); 281 perror (msg);
282 abort (); 282 abort ();
283 } 283 }
284} 284}
285 285
286static void *(*alloc)(void *ptr, size_t size) = realloc; 286static void *(*alloc)(void *ptr, long size);
287 287
288void 288void
289ev_set_allocator (void *(*cb)(void *ptr, size_t size)) 289ev_set_allocator (void *(*cb)(void *ptr, long size))
290{ 290{
291 alloc = cb; 291 alloc = cb;
292} 292}
293 293
294inline_speed void * 294inline_speed void *
295ev_realloc (void *ptr, size_t size) 295ev_realloc (void *ptr, long size)
296{ 296{
297 ptr = alloc (ptr, size); 297 ptr = alloc ? alloc (ptr, size) : realloc (ptr, size);
298 298
299 if (!ptr && size) 299 if (!ptr && size)
300 { 300 {
301 fprintf (stderr, "libev: cannot allocate %ld bytes, aborting.", (long)size); 301 fprintf (stderr, "libev: cannot allocate %ld bytes, aborting.", size);
302 abort (); 302 abort ();
303 } 303 }
304 304
305 return ptr; 305 return ptr;
306} 306}
324{ 324{
325 W w; 325 W w;
326 int events; 326 int events;
327} ANPENDING; 327} ANPENDING;
328 328
329#if EV_USE_INOTIFY
329typedef struct 330typedef struct
330{ 331{
331#if EV_USE_INOTIFY
332 WL head; 332 WL head;
333#endif
334} ANFS; 333} ANFS;
334#endif
335 335
336#if EV_MULTIPLICITY 336#if EV_MULTIPLICITY
337 337
338 struct ev_loop 338 struct ev_loop
339 { 339 {
1889 /* we copy this here each the time so that */ 1889 /* we copy this here each the time so that */
1890 /* prev has the old value when the callback gets invoked */ 1890 /* prev has the old value when the callback gets invoked */
1891 w->prev = w->attr; 1891 w->prev = w->attr;
1892 ev_stat_stat (EV_A_ w); 1892 ev_stat_stat (EV_A_ w);
1893 1893
1894 if (memcmp (&w->prev, &w->attr, sizeof (ev_statdata))) 1894 /* memcmp doesn't work on netbsd, they.... do stuff to their struct stat */
1895 if (
1896 w->prev.st_dev != w->attr.st_dev
1897 || w->prev.st_ino != w->attr.st_ino
1898 || w->prev.st_mode != w->attr.st_mode
1899 || w->prev.st_nlink != w->attr.st_nlink
1900 || w->prev.st_uid != w->attr.st_uid
1901 || w->prev.st_gid != w->attr.st_gid
1902 || w->prev.st_rdev != w->attr.st_rdev
1903 || w->prev.st_size != w->attr.st_size
1904 || w->prev.st_atime != w->attr.st_atime
1905 || w->prev.st_mtime != w->attr.st_mtime
1906 || w->prev.st_ctime != w->attr.st_ctime
1895 { 1907 ) {
1896 #if EV_USE_INOTIFY 1908 #if EV_USE_INOTIFY
1897 infy_del (EV_A_ w); 1909 infy_del (EV_A_ w);
1898 infy_add (EV_A_ w); 1910 infy_add (EV_A_ w);
1899 ev_stat_stat (EV_A_ w); /* avoid race... */ 1911 ev_stat_stat (EV_A_ w); /* avoid race... */
1900 #endif 1912 #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines