[comp.sys.amiga.tech] Bug with lattice open

hue@netcom.UUCP (Jonathan Hue) (03/04/90)

Has anyone else had problems with open using the O_EXCL flag with Lattice
C?  I've had problems with 5.04A and 5.05.  The following program causes
a "Software Error, Task Held".  It runs fine on UNIX boxes and does the
right thing.  Am I doing something incredibly stupid that I can't see?

----------------------save this as opentest.c----------------------
#include <fcntl.h>
#include <stdio.h>

main()
{
    int fd;

    switch(fd = open("opentest", O_WRONLY | O_CREAT | O_EXCL, 0777))
    {
      case -1:
	fprintf(stderr, "open failed, test passed\n");
        break;
      default:
	fprintf(stderr, "open succeeded, test failed\n");
	break;
    }
}

-Jonathan

louie@sayshell.umd.edu (Louis A. Mamakos) (03/05/90)

I've also experience the O_EXCL problem with Lattice 5.04 and 5.04a.  I get
a GURU when doing the open when the file already exists:

	if((fd = open(lockname, O_WRONLY|O_EXCL|O_CREAT,0600)) == -1)
		return -1;

This is a pretty annoying problem. I haven't check 5.05 yet, but I don't 
think that any of the library routines involved were updated.