Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: cschuber@passer.osg.gov.bc.ca (Cy Schubert - BCSC Open Systems Group)
Subject: fdopen() Bug
Date: 9 Jun 94 13:02:10 PDT	[thread overview]
Message-ID: <1994Jun9.130210.4298@vmsmail.gov.bc.ca> (raw)

Has anoyone come across a bug in fdopen() where it complains about a vaild
argument list and core dumps?  Here is a sample program.  Is a fix available?


#include <stdio.h>
#include <sys/fcntl.h>
#include <errno.h>

main()
{
  FILE *lockfile;
  int lockfd, i;
  char hostname[80];

  lockfd = open("xyz", O_CREAT , S_IRUSR | S_IWUSR);
  lockfile = fdopen(lockfd, "r");
  perror("error at fdopen:");
  printf("%d  %d\n",lockfd,lockfile);
  gethostname(hostname, sizeof(hostname));
  fprintf(lockfile, "%s %d\n", hostname, getpid());
  fclose(lockfile);
  return 0;
  close(lockfd);
}



Regards,                       Phone:  (604)389-3827
Cy Schubert                    OV/VM:  BCSC02(CSCHUBER)
Open Systems & MVS Support    BITNET:  CSCHUBER@BCSC02.BITNET
BC Systems Corp.            Internet:  cschuber@bcsc02.gov.bc.ca
                                       cschuber@uumail.gov.bc.ca


                 reply	other threads:[~1994-06-09 20:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox