USG_PG3/usr/source/sccsutil2/xopen.c

Compare this file to the similar file:
Show the results in this format:

char xopen_____[] "~|^`xopen.c:	2.2";
/*
	Interface to open(II) which differentiates among the various
	open errors.
*/

xopen(name,mode)
char name[];
int mode;
{
	register int fd;
	extern int errno;

	if((fd=open(name,mode)) >= 0) return(fd);
	if(errno == 2) fatal("`",name,"' nonexistent (208)");
	if(errno == 13) {
		if(mode == 0) fatal("`",name,"' unreadable (209)");
		if(mode == 1) fatal("`",name,"' unwritable (210)");
		fatal("`",name,"' unreadable or unwritable (211)");
	}
	fatal(stringf("error %d opening `%s' (212)",errno,name));
}