~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to erts/emulator/test/driver_SUITE_data/chkio_drv.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
#ifndef UNIX
20
 
#if !defined(__WIN32__) && !defined(_OSE_) && !defined(VXWORKS)
 
20
#if !defined(__WIN32__) && !defined(VXWORKS)
21
21
#define UNIX 1
22
22
#endif
23
23
#endif
102
102
    int write_fd;
103
103
    int next_read;
104
104
    int next_write;
 
105
    int first_write;
105
106
    enum {Closed, Opened, Selected, Waiting} state;
106
107
    int wasSelected;
107
108
    unsigned rand_state;
577
578
        inPipe = (pip->next_write - pip->next_read);
578
579
        if (inPipe == 0) {
579
580
            bytes = read(pip->read_fd, &word, sizeof(word));
580
 
            printf("Unexpected empty pipe, expected %u -> %u, bytes=%d, word=%d\n",
581
 
                   pip->next_read, pip->next_write-1, bytes, word);
582
 
            abort();
 
581
            printf("Unexpected empty pipe, expected %u -> %u, bytes=%d, word=%d, written=%d\n",
 
582
                   pip->next_read, pip->next_write-1, bytes, word,
 
583
                   (pip->next_write - pip->first_write));
 
584
            /*abort();
 
585
              Allow unexpected events as it's been seen to be triggered by epoll
 
586
              on Linux. Most of the time the unwanted events are filtered by
 
587
              the erl_check_io layer. But when fd's are reused the events may
 
588
              slip up to the driver.
 
589
            */
 
590
            break; 
583
591
        }
584
592
 
585
593
        n = rand_r(&pip->rand_state) % (inPipe*4);
1252
1260
                pip->state = Opened;
1253
1261
                pip->wasSelected = 0;
1254
1262
                pip->next_write = pip->next_read = rand_r(&pip->rand_state) % 1024;
 
1263
                pip->first_write = pip->next_write;
1255
1264
                if (op & 1) break;
1256
1265
                op >>= 1;
1257
1266
            }/*fall through*/