xterm.c (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) xterm.c (b4fd310e163477236a241580b3b8c29aee65f4cc)
1/*
2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdio.h>
7#include <stdlib.h>
8#include <unistd.h>

--- 96 unchanged lines hidden (view full) ---

105 * will work but w/o it we can be pretty sure it won't. */
106 if (!getenv("DISPLAY")) {
107 printk("xterm_open: $DISPLAY not set.\n");
108 return -ENODEV;
109 }
110
111 fd = mkstemp(file);
112 if(fd < 0){
1/*
2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdio.h>
7#include <stdlib.h>
8#include <unistd.h>

--- 96 unchanged lines hidden (view full) ---

105 * will work but w/o it we can be pretty sure it won't. */
106 if (!getenv("DISPLAY")) {
107 printk("xterm_open: $DISPLAY not set.\n");
108 return -ENODEV;
109 }
110
111 fd = mkstemp(file);
112 if(fd < 0){
113 err = -errno;
113 printk("xterm_open : mkstemp failed, errno = %d\n", errno);
114 printk("xterm_open : mkstemp failed, errno = %d\n", errno);
114 return(-errno);
115 return err;
115 }
116
117 if(unlink(file)){
116 }
117
118 if(unlink(file)){
119 err = -errno;
118 printk("xterm_open : unlink failed, errno = %d\n", errno);
120 printk("xterm_open : unlink failed, errno = %d\n", errno);
119 return(-errno);
121 return err;
120 }
121 os_close_file(fd);
122
123 fd = os_create_unix_socket(file, sizeof(file), 1);
124 if(fd < 0){
125 printk("xterm_open : create_unix_socket failed, errno = %d\n",
126 -fd);
127 return(fd);

--- 98 unchanged lines hidden ---
122 }
123 os_close_file(fd);
124
125 fd = os_create_unix_socket(file, sizeof(file), 1);
126 if(fd < 0){
127 printk("xterm_open : create_unix_socket failed, errno = %d\n",
128 -fd);
129 return(fd);

--- 98 unchanged lines hidden ---