newfd = open(path, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR);
newfd = open(path, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR, mode);
create_newfile(Tcl_Interp *interp, const char *path, int target, struct stat *sbp){	char backup[MAXPATHLEN];	int saved_errno = 0;	int newfd;	if (target) {		/*		 * Unlink now... avoid ETXTBSY errors later.  Try to turn		 * off the append/immutable bits -- if we fail, go ahead,		 * it might work.		 */		if (sbp->st_flags & NOCHANGEBITS)			(void)chflags(path, sbp->st_flags & ~NOCHANGEBITS);		if (dobackup) {			if ((size_t)snprintf(backup, MAXPATHLEN, "%s%s",			    path, suffix) != strlen(path) + strlen(suffix)) {				char errmsg[255];				snprintf(errmsg, sizeof errmsg, "%s: backup filename too long", path);				Tcl_SetResult(interp, errmsg, TCL_VOLATILE);				return -1;			}			(void)snprintf(backup, MAXPATHLEN, "%s%s", path, suffix);			if (verbose) {				char msg[255];				snprintf(msg, sizeof msg, "install: %s -> %s\n", path, backup);				ui_info(interp, msg);			}			if (rename(path, backup) < 0) {				char errmsg[255];				snprintf(errmsg, sizeof errmsg,					 "rename: %s to %s, %s", path, backup, strerror(errno));				Tcl_SetResult(interp, errmsg, TCL_VOLATILE);				return -1;			}		} else			if (unlink(path) < 0)				saved_errno = errno;	}	newfd = open(path, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR);	if (newfd < 0 && saved_errno != 0)		errno = saved_errno;	return newfd;}