This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/14504] New: fopencookie does not call the close callback on system cleanup


http://sourceware.org/bugzilla/show_bug.cgi?id=14504

             Bug #: 14504
           Summary: fopencookie does not call the close callback on system
                    cleanup
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
        AssignedTo: unassigned@sourceware.org
        ReportedBy: mvr@google.com
    Classification: Unclassified


Whan a file opened with fopencookie is automatically closed on the process
exit, the close callback should be called.

Test code:

int cookie_close(void* cookie) {
  printf("closing file %d\n", *(int*)cookie);
  return 0;
}

cookie_io_functions_t fns = { NULL, NULL, NULL, cookie_close };

int mycookie = 42;
int main() {
  FILE* f = fopencookie(&mycookie, "r", fns);
  return 0;
}

Expected output: "closing file 42"
Actual output: empty

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]