[uClibc]fdopen checking for append mode agreenment?

m4 at brecis.COM m4 at brecis.COM
Fri May 3 17:32:12 UTC 2002


Did I miss stdio discussion about fdopen checking for append mode agreement,
in the 9.9 move to 9.10 (or beyond -- using 2002/04/22 snapshot)?

One common thing that have been working for years..., that I just found:

/* httpd.c:  A very simple http server
 *
 * Copyright (c) 1997-1999 D. Jeff Dionne <jeff at rt-control.com>
 * Copyright (c) 1998      Kenneth Albanowski <kjahds at kjahds.com>
 * Copyright (c) 1999      Nick Brok <nick at nbrok.iaehv.nl>
...
    if((fd = accept(s, (void *)&ec, &len)) == -1) {
      exit(5);
      close(s);
    }
    HandleConnect(fd);
...

int
HandleConnect(int fd)
{
  FILE *f;

  char buf[160];
  char buf1[160];

  f = fdopen(fd,"a+");
  if (!f) {
    fprintf(stderr, "httpd: Unable to open httpd input fd, error %d\n", errno);
...
------------------------------------------------------------------------------
A simple "a" to "r" (or "w") fixes it, but I thought I should ask... .



More information about the uClibc mailing list