Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-195

bson_oid_generated_time returns garbage on systems where time_t is 64bits

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 0.8.1
    • Affects Version/s: 0.6, 0.7, 0.7.1
    • Component/s: None
    • Labels:
    • Environment:
      Ubuntu 12.04.1 LTS
      kernel: 3.2.0-25-virtual
      x86_64
    • Fully Compatible

      The bson_oid_generated_time function fills in the first 4 bytes of a time_t and returns it. However, time_t length is system dependent. On my mac, it's 32 bits, but on my Ubuntu EC2 machine, it's 64. So on Ubuntu, I'm getting nonsense. Works correctly if I cast the result to a 32 bit int, and then back to a time_t.

            Assignee:
            gjmurakami Gary Murakami
            Reporter:
            davidcrawford David Crawford
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: