if ((fd = open(src->ascii_src.string, open_mode, 0666))) {
if ((fd = open(src->ascii_src.string, open_mode, 0666)) != -1) {
InitStringOrFile(src, newString)AsciiSrcObject src;Boolean newString;{    mode_t open_mode = 0;    const char *fdopen_mode = NULL;    int fd;    FILE * file;    char fileName[TMPSIZ];    if (src->ascii_src.type == XawAsciiString) {	if (src->ascii_src.string == NULL)	    src->ascii_src.length = 0;	else if (! src->ascii_src.use_string_in_place) {	    src->ascii_src.string = XtNewString(src->ascii_src.string);	    src->ascii_src.allocated_string = True;	    src->ascii_src.length = strlen(src->ascii_src.string);	}	if (src->ascii_src.use_string_in_place) {	    src->ascii_src.length = strlen(src->ascii_src.string);	    /* In case the length resource is incorrectly set */	    if (src->ascii_src.length > src->ascii_src.ascii_length)		src->ascii_src.ascii_length = src->ascii_src.length;	    if (src->ascii_src.ascii_length == MAGIC_VALUE) 		src->ascii_src.piece_size = src->ascii_src.length;	    else		src->ascii_src.piece_size = src->ascii_src.ascii_length + 1;	}			return(NULL);    }/* * type is XawAsciiFile. */        src->ascii_src.is_tempfile = FALSE;    switch (src->text_src.edit_mode) {    case XawtextRead:	if (src->ascii_src.string == NULL)	    XtErrorMsg("NoFile", "asciiSourceCreate", "XawError",		     "Creating a read only disk widget and no file specified.",		       NULL, 0);	open_mode = O_RDONLY;	fdopen_mode = "r";	break;    case XawtextAppend:    case XawtextEdit:	if (src->ascii_src.string == NULL) {	    src->ascii_src.string = fileName;	    (void) tmpnam(src->ascii_src.string);	    src->ascii_src.is_tempfile = TRUE;	    open_mode = O_WRONLY | O_CREAT | O_EXCL;	    fdopen_mode = "w";	} else {/* O_NOFOLLOW is a BSD & Linux extension */#ifdef O_NOFOLLOW	    open_mode = O_RDWR | O_NOFOLLOW;#else	    open_mode = O_RDWR; /* unsafe; subject to race conditions */#endif	    fdopen_mode = "r+";	}	break;    default:	XtErrorMsg("badMode", "asciiSourceCreate", "XawError",		"Bad editMode for ascii source; must be Read, Append or Edit.",		   NULL, NULL);    }    /* Allocate new memory for the temp filename, because it is held in     * a stack variable, not static memory.  This widget does not need     * to keep the private state field is_tempfile -- it is only accessed     * in this routine, and its former setting is unused.     */    if (newString || src->ascii_src.is_tempfile) {	src->ascii_src.string = XtNewString(src->ascii_src.string);	src->ascii_src.allocated_string = TRUE;    }        if (!src->ascii_src.is_tempfile) {	if ((fd = open(src->ascii_src.string, open_mode, 0666))) {	    if ((file = fdopen(fd, fdopen_mode)) != NULL) {		(void)fseek(file, 0, SEEK_END);		src->ascii_src.length = (XawTextPosition)ftell(file);		return (file);	    }	}	{	    String params[2];	    Cardinal num_params = 2;	    	    params[0] = src->ascii_src.string;	    params[1] = strerror(errno);	    XtAppWarningMsg(XtWidgetToApplicationContext((Widget)src),			    "openError", "asciiSourceCreate", "XawWarning",			    "Cannot open file %s; %s", params, &num_params);	}    }    src->ascii_src.length = 0;    return(NULL);}