~ubuntu-branches/ubuntu/trusty/uwsgi/trusty

« back to all changes in this revision

Viewing changes to event.c

  • Committer: Package Import Robot
  • Author(s): Janos Guljas
  • Date: 2012-02-13 03:43:28 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120213034328-d02hz8m5pon6kaxf
Tags: 1.0.3+dfsg-1
* New upstream version.
* Adjust rack plugin LD_RUN_PATH patch.
* Adjust patch for uWSGI Control Center jQuery links in templates.
* Remove '-fno-strict-aliasing' CFLAG patch as it is implemented upstream.
* Remove fix indentation of uwsgidecorators_py patch as implemented upstream.
* Adjust init scripts to use top-bottom options order, as --inherit option
  is not working as in earlier versions. 
* Update debian/copyright file.
* Add LSB Description field to debian/uwsgi.init.d.
* Set Architecture to "all" for binary package uwsgi-extra because
  it contains no architecture dependent files.
* Change uwsgi description. (Closes: #640698)
* New binary packages:
  - uwsgi-plugin-carbon
  - uwsgi-plugin-graylog2
  - uwsgi-plugin-logsocket
  - uwsgi-plugin-probeconnect
  - uwsgi-plugin-probepg
  - uwsgi-plugin-rrdtool
  - uwsgi-plugin-rsyslog
  - uwsgi-plugin-signal
  - uwsgi-plugin-symcall
  - uwsgi-plugin-syslog
* python-uwsgidecorators:
  - fix binary-install rule to call dh_python2
  - remove debian/source.lintian-overrides
* uwsgi-plugin-jvm-openjdk-6:
  - fix FTBFS on armel and powerpc (Closes: #656280)
* uwsgi-plugin-python:
  - document issue "ImportError: No module named site" when using
    virtualenv with Python 2.6 in README.Debian (Closes: #654333)
* Adjust debian/watch uversionmangle option.
* Repack upstram source to remove minimized jQuery and jQuery UI JavaScript
  libraries:
  - add get-orig-source rule to debian/rules
  - append +dfsg to upstream version
  - update debian/watch with dversionmangle option

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
int event_queue_interesting_fd(void *events, int id) {
82
82
        port_event_t *pe = (port_event_t *) events;
83
83
        if (pe[id].portev_source == PORT_SOURCE_FILE || pe[id].portev_source == PORT_SOURCE_TIMER) {
84
 
                return (int) pe[id].portev_user;
 
84
                return (long) pe[id].portev_user;
85
85
        }
86
86
 
87
87
        return (int) pe[id].portev_object;
149
149
 
150
150
 
151
151
        if (pe.portev_source == PORT_SOURCE_FILE || pe.portev_source == PORT_SOURCE_TIMER) {
152
 
                *interesting_fd = (int) pe.portev_user;
 
152
                *interesting_fd = (long) pe.portev_user;
153
153
        }
154
154
        else {
155
155
                *interesting_fd = (int) pe.portev_object;
327
327
 
328
328
        struct kevent kev;
329
329
 
 
330
#ifndef __FreeBSD__
330
331
        EV_SET(&kev, fd, EVFILT_WRITE, EV_DISABLE, 0, 0, 0);
331
332
        if (kevent(eq, &kev, 1, NULL, 0, NULL) < 0) {
332
333
                uwsgi_error("kevent()");
333
334
                return -1;
334
335
        }
 
336
#endif
335
337
 
336
338
        EV_SET(&kev, fd, EVFILT_READ, EV_ADD, 0, 0, 0);
337
339
        if (kevent(eq, &kev, 1, NULL, 0, NULL) < 0) {
476
478
        fo.fo_ctime = st.st_ctim;
477
479
        
478
480
        fmon_id++;
479
 
        if (port_associate(eq, PORT_SOURCE_FILE, (uintptr_t) &fo, FILE_MODIFIED|FILE_ATTRIB, (void *) fmon_id)) {
 
481
        if (port_associate(eq, PORT_SOURCE_FILE, (uintptr_t) &fo, FILE_MODIFIED|FILE_ATTRIB, (void *) (long) fmon_id)) {
480
482
                uwsgi_error("port_associate()");
481
483
                return -1;
482
484
        }
506
508
                                fo.fo_atime = st.st_atim;
507
509
                                fo.fo_mtime = st.st_mtim;
508
510
                                fo.fo_ctime = st.st_ctim;
509
 
                                if (port_associate(eq, PORT_SOURCE_FILE, (uintptr_t) &fo, FILE_MODIFIED|FILE_ATTRIB, (void *)id)) {
 
511
                                if (port_associate(eq, PORT_SOURCE_FILE, (uintptr_t) &fo, FILE_MODIFIED|FILE_ATTRIB, (void *)(long)id)) {
510
512
                                        uwsgi_error("port_associate()");
511
513
                                        return NULL;
512
514
                                }
565
567
#endif
566
568
 
567
569
#ifdef UWSGI_EVENT_FILEMONITOR_USE_INOTIFY
 
570
 
 
571
 
 
572
#ifdef OBSOLETE_LINUX_KERNEL
 
573
int event_queue_add_file_monitor(int eq, char *filename, int *id) {
 
574
        return -1;
 
575
}
 
576
struct uwsgi_fmon *event_queue_ack_file_monitor(int eq, int id) {
 
577
        return NULL;
 
578
}
 
579
#else
568
580
#include <sys/inotify.h>
569
581
 
570
582
int event_queue_add_file_monitor(int eq, char *filename, int *id) {
657
669
        return NULL;
658
670
        
659
671
}
 
672
 
 
673
#endif
660
674
#endif
661
675
 
662
676
#ifdef UWSGI_EVENT_TIMER_USE_TIMERFD
687
701
 
688
702
 
689
703
static int timerfd_create (clockid_t __clock_id, int __flags) {
 
704
#ifdef __amd64__
 
705
        return syscall(283, __clock_id, __flags);
 
706
#elif defined(__i386__)
690
707
        return syscall(322, __clock_id, __flags);
 
708
#else
 
709
        return -1;
 
710
#endif
691
711
}
692
712
 
693
713
static int timerfd_settime (int __ufd, int __flags,
694
714
                            __const struct itimerspec *__utmr,
695
715
                            struct itimerspec *__otmr) {
 
716
#ifdef __amd64__
 
717
        return syscall(286, __ufd, __flags, __utmr, __otmr);
 
718
#elif defined(__i386__)
696
719
        return syscall(325, __ufd, __flags, __utmr, __otmr);
 
720
#endif
697
721
}
698
722
#endif
699
723
 
765
789
        timer_id++;
766
790
 
767
791
        pnotif.portnfy_port = eq;
768
 
        pnotif.portnfy_user = (void *) timer_id;
 
792
        pnotif.portnfy_user = (void *) (long) timer_id;
769
793
 
770
794
        sigev.sigev_notify = SIGEV_PORT;
771
795
        sigev.sigev_value.sival_ptr = &pnotif;